Skip to content

Commit 3b4513e

Browse files
committed
Update hostname regex to accept "-"
Updated hostname regex to accept "-" according to RFC 1123
1 parent fdc1312 commit 3b4513e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/frontend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func buildTemplate() *template.Template {
153153
}
154154

155155
func isValidHostname(host string) (string, bool) {
156-
valid, _ := regexp.Match("^[a-z0-9]{1,32}$", []byte(host))
156+
valid, _ := regexp.Match("^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?)$", []byte(host))
157157

158158
return host, valid
159159
}

0 commit comments

Comments
 (0)