]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document that ProxyFromEnvironment special-cases localhost
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 19 May 2014 17:12:15 +0000 (10:12 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 19 May 2014 17:12:15 +0000 (10:12 -0700)
Fixes #7256

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, rsc
https://golang.org/cl/97590043

src/pkg/net/http/transport.go

index 2ffc40471266a83fb958b9ad6ea72b75381e2780..b1cc632a782da8a76f5a567d08bb491310136229 100644 (file)
@@ -109,6 +109,9 @@ type Transport struct {
 // An error is returned if the proxy environment is invalid.
 // A nil URL and nil error are returned if no proxy is defined in the
 // environment, or a proxy should not be used for the given request.
+//
+// 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.
 func ProxyFromEnvironment(req *Request) (*url.URL, error) {
        proxy := httpProxyEnv.Get()
        if proxy == "" {