fix(middleware/redirect): use net.JoinHostPort for setting HTTPS host

This commit is contained in:
yusing
2026-01-09 02:29:50 +08:00
parent 45d6e3bab7
commit 7687dca456

View File

@@ -39,7 +39,7 @@ func (m *redirectHTTP) before(w http.ResponseWriter, r *http.Request) (proceed b
} }
if common.ProxyHTTPSPort != 443 { if common.ProxyHTTPSPort != 443 {
r.URL.Host = host + ":" + strconv.Itoa(common.ProxyHTTPSPort) r.URL.Host = net.JoinHostPort(host, strconv.Itoa(common.ProxyHTTPSPort))
} else { } else {
r.URL.Host = host r.URL.Host = host
} }