diff --git a/header.go b/header.go index a037314..f710904 100644 --- a/header.go +++ b/header.go @@ -44,7 +44,7 @@ func GetDomain(req *http.Request) string { var host string = GetHost(req) hosts := strings.Split(host, ":") host = hosts[0] - if hosts[1] == "443" { + if len(hosts) > 1 && hosts[1] == "443" { scheme = "https://" } var w strings.Builder