net/http: provide better error message when proxy is misconfigured
#29,809 建立於 2019年1月18日
倉庫指標
- Star
- (133,883 star)
- PR 合併指標
- (30 天內沒有已合併 PR)
描述
What version of Go are you using (go version)?
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
What did you do?
Doing a go get fails behind a corporate proxy if environment variables are set as below; HTTP_PROXY=http://proxyIp:proxyPort
it succeeds if set as
HTTP_PROXY=proxyIp:proxyPort
this is true for HTTP or HTTPS variables This is also true for any go project using net/http
I'm seeing this issue with Docker versions greater than 17.09, Jenkins-x, goBuffalo
Older versions of go (specifically 1.8.3 - the only version I tested) do not behave this way
Docker version 17.09 and lower do not behave this way.
What did you expect to see?
I expect it to pull through the proxy server with the below environment variables set;
HTTP_PROXY=http://proxyIp:proxyPort
HTTPS_PROXY=https://proxyIp:proxyPort
What did you see instead?
Process fails to get through the proxy.