Update hostname regex to accept "-"
Updated hostname regex to accept "-" according to RFC 1123
This commit is contained in:
parent
fdc1312c44
commit
3b4513eebd
|
@ -153,7 +153,7 @@ func buildTemplate() *template.Template {
|
||||||
}
|
}
|
||||||
|
|
||||||
func isValidHostname(host string) (string, bool) {
|
func isValidHostname(host string) (string, bool) {
|
||||||
valid, _ := regexp.Match("^[a-z0-9]{1,32}$", []byte(host))
|
valid, _ := regexp.Match("^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?)$", []byte(host))
|
||||||
|
|
||||||
return host, valid
|
return host, valid
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue