chore: add location header

This commit is contained in:
johnnyjoy
2024-08-18 10:20:50 +08:00
parent 80548aaf2c
commit a3943f5b2d
3 changed files with 42 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"crypto/rand"
"math/big"
"net/mail"
"net/url"
"strconv"
"strings"
)
@ -55,3 +56,9 @@ func RandomString(n int) (string, error) {
}
return sb.String(), nil
}
// ValidateURI validates the URI.
func ValidateURI(uri string) bool {
u, err := url.Parse(uri)
return err == nil && u.Scheme != "" && u.Host != ""
}