Improve random ipv6 log

This commit is contained in:
Ben Sarmiento
2024-02-05 02:11:52 +01:00
parent f0bf9c6895
commit f2e9d927ea

View File

@@ -202,8 +202,8 @@ func (r *HTTPClient) replaceHostIfNeeded(req *http.Request) {
}
if !found && !r.CanFetchFirstByte(req.URL.String()) {
req.Host = r.ipv6Hosts[rand.Intn(len(r.ipv6Hosts))]
r.log.Debugf("Host %s is not a valid IPv6 host, assigning a random IPv6 host: %s", req.URL.Host, req.Host)
req.URL.Host = req.Host
r.log.Debugf("Host is not a valid IPv6 host, assigning a random IPv6 host: %s", req.Host)
} else {
r.ipv6Hosts = append(r.ipv6Hosts, req.Host)
}