Fix ipv6 stuffs 7

This commit is contained in:
Ben Sarmiento
2024-01-11 03:07:55 +01:00
parent c200a6f80c
commit c4fd7358b9

View File

@@ -215,10 +215,9 @@ func (r *HTTPClient) replaceHostIfNeeded(req *http.Request) {
return
}
// if hosts are found, ensure the host is an IPv6 host
host, port, err := net.SplitHostPort(req.URL.Host)
host, _, err := net.SplitHostPort(req.URL.Host)
if err != nil {
host = req.URL.Host // Use the host without port
port = "443" // Default HTTPS port
}
found := false
for _, h := range r.ipv6Hosts {