From 1451ae01483bedb221db89a4960880a6c4328267 Mon Sep 17 00:00:00 2001 From: gz Date: Wed, 17 Apr 2024 14:46:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9GetDomain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- header.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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