From c6ed85c7a12db1bd15e993fd3ae4700b2e9f2c84 Mon Sep 17 00:00:00 2001 From: Alexander Yastrebov Date: Mon, 18 Oct 2021 14:28:36 +0000 Subject: [PATCH] http/httpproxy: document all loopbacks are special cased not just localhost Fixes golang/go#33695 Change-Id: I2f7598da7c6fda161ba357a75bba72de2fee8226 GitHub-Last-Rev: 443dbb13b1dc9ec275cdb796caf31dd3b6b658c3 GitHub-Pull-Request: golang/net#116 Reviewed-on: https://go-review.googlesource.com/c/net/+/356510 Reviewed-by: Damien Neil Trust: Damien Neil Trust: Cherry Mui Run-TryBot: Damien Neil --- http/httpproxy/proxy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/httpproxy/proxy.go b/http/httpproxy/proxy.go index 1415b077..d2c8c87e 100644 --- a/http/httpproxy/proxy.go +++ b/http/httpproxy/proxy.go @@ -113,8 +113,8 @@ func getEnvAny(names ...string) string { // environment, or a proxy should not be used for the given request, as // defined by NO_PROXY. // -// As a special case, if req.URL.Host is "localhost" (with or without a -// port number), then a nil URL and nil error will be returned. +// As a special case, if req.URL.Host is "localhost" or a loopback address +// (with or without a port number), then a nil URL and nil error will be returned. func (cfg *Config) ProxyFunc() func(reqURL *url.URL) (*url.URL, error) { // Preprocess the Config settings for more efficient evaluation. cfg1 := &config{