diff --git a/src/pkg/net/http/transport.go b/src/pkg/net/http/transport.go index 41ac7dea148..bd2106593b4 100644 --- a/src/pkg/net/http/transport.go +++ b/src/pkg/net/http/transport.go @@ -109,9 +109,11 @@ func ProxyFromEnvironment(req *Request) (*url.URL, error) { } proxyURL, err := url.Parse(proxy) if err != nil || !strings.HasPrefix(proxyURL.Scheme, "http") { - if u, err := url.Parse("http://" + proxy); err == nil { - proxyURL = u - err = nil + // proxy was bogus. Try prepending "http://" to it and + // see if that parses correctly. If not, we fall + // through and complain about the original one. + if proxyURL, err := url.Parse("http://" + proxy); err == nil { + return proxyURL, nil } } if err != nil {