Merge pull request #30 from ssiuhk/fix_hostname

Update hostname regex to accept "-"
This commit is contained in:
Philipp Böhm 2021-02-20 13:12:39 +01:00 committed by GitHub
commit 016eea259c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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
}