From 3b4513eebdfc602f1dd5ec5584595963b8eedbdc Mon Sep 17 00:00:00 2001 From: Sam SIU <23556929+ssiuhk@users.noreply.github.com> Date: Wed, 17 Feb 2021 00:23:28 +0800 Subject: [PATCH] Update hostname regex to accept "-" Updated hostname regex to accept "-" according to RFC 1123 --- frontend/frontend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/frontend.go b/frontend/frontend.go index 649af96..5844326 100644 --- a/frontend/frontend.go +++ b/frontend/frontend.go @@ -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 }