mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 03:43:39 +00:00
fix: use u.Hostname() instead of u.Host to avoid ipv6 host parse failed
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user