Merge pull request #30 from ssiuhk/fix_hostname
Update hostname regex to accept "-"
This commit is contained in:
commit
016eea259c
|
@ -153,7 +153,7 @@ func buildTemplate() *template.Template {
|
|||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue