From 7af1dc42d4bd1ecca6eb705b67cba3548317b33b Mon Sep 17 00:00:00 2001 From: creamlike1024 Date: Wed, 17 Sep 2025 23:47:59 +0800 Subject: [PATCH] fix: use u.Hostname() instead of u.Host to avoid ipv6 host parse failed --- common/ssrf_protection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/ssrf_protection.go b/common/ssrf_protection.go index 40d3b10b..6f7d289f 100644 --- a/common/ssrf_protection.go +++ b/common/ssrf_protection.go @@ -237,7 +237,7 @@ func (p *SSRFProtection) ValidateURL(urlStr string) error { host, portStr, err := net.SplitHostPort(u.Host) if err != nil { // 没有端口,使用默认端口 - host = u.Host + host = u.Hostname() if u.Scheme == "https" { portStr = "443" } else {