diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/http.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/http.go b/src/http.go index 13276f7..c5e982d 100644 --- a/src/http.go +++ b/src/http.go @@ -9,6 +9,7 @@ import ( "log" "net/http" "os" + "regexp" "strings" "github.com/gorilla/mux" @@ -114,7 +115,14 @@ func isUniq(username string) bool { } func isValid(username string) bool { - if username == "traefik" || username == "register" { + // reserved subdomains + if username == "traefik" || username == "register" || username == "scoreboard" || username == "grafana" { + return false + } + + // valid Format + var validFormat = regexp.MustCompile("^[a-zA-Z0-9]{1,60}$") + if validFormat.MatchString(username) == false { return false } return true |