From 2d3c203f0f87e6a14335075b8379eed82aac88aa Mon Sep 17 00:00:00 2001 From: Pavol Ipoth Date: Tue, 9 Apr 2024 14:00:31 +0200 Subject: [PATCH] net/httpproxy: remove loopback check in useProxy func Fixes golang/go#51416 --- http/httpproxy/proxy.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/http/httpproxy/proxy.go b/http/httpproxy/proxy.go index 6404aaf157..12de9bfb58 100644 --- a/http/httpproxy/proxy.go +++ b/http/httpproxy/proxy.go @@ -174,16 +174,8 @@ func (cfg *config) useProxy(addr string) bool { if err != nil { return false } - if host == "localhost" { - return false - } - ip := net.ParseIP(host) - if ip != nil { - if ip.IsLoopback() { - return false - } - } + ip := net.ParseIP(host) addr = strings.ToLower(strings.TrimSpace(host)) if ip != nil {