Skip to content

Commit 941f44a

Browse files
author
Alexander Merkle
committed
build,add: add support for corporate proxies
Use the Proxy Environment http_proxy/HTTPS_PROXY/NO_PROXY to handle the http request. Signed-off-by: Alexander Merkle <[email protected]>
1 parent 1b5cdd5 commit 941f44a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

add.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ func getURL(src string, chown *idtools.IDPair, mountpoint, renameTarget string,
141141
}
142142
tlsClientConfig.InsecureSkipVerify = insecureSkipTLSVerify == types.OptionalBoolTrue
143143

144-
tr := &http.Transport{TLSClientConfig: tlsClientConfig}
144+
tr := &http.Transport{
145+
TLSClientConfig: tlsClientConfig,
146+
Proxy: http.ProxyFromEnvironment,
147+
}
145148
httpClient := &http.Client{Transport: tr}
146149
response, err := httpClient.Get(src)
147150
if err != nil {

0 commit comments

Comments
 (0)