summaryrefslogtreecommitdiff
path: root/http/client
diff options
context:
space:
mode:
authorGravatar Lee Tang <D0zingcat@users.noreply.github.com> 2020-10-31 10:03:41 +0800
committerGravatar GitHub <noreply@github.com> 2020-10-30 19:03:41 -0700
commit46c13b51851374b445ed0458c321808bd83e8869 (patch)
tree4c97f3fea8b829b1a3b7f070a08cabf2f5cb616f /http/client
parentd70b4d39abc86151e7e6bc04fdc4dd7e8e339e6e (diff)
downloadv2-46c13b51851374b445ed0458c321808bd83e8869.tar.gz
v2-46c13b51851374b445ed0458c321808bd83e8869.tar.zst
v2-46c13b51851374b445ed0458c321808bd83e8869.zip
Restore the ability to use a proxy for all HTTP requests
The default transport was changed in commit 0d66f2c and the proxy feature was forgotten. - https://golang.org/src/net/http/transport.go#L43 - https://golang.org/pkg/net/http/#ProxyFromEnvironment
Diffstat (limited to 'http/client')
-rw-r--r--http/client/client.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/http/client/client.go b/http/client/client.go
index 4d91b3e8..eb889d8e 100644
--- a/http/client/client.go
+++ b/http/client/client.go
@@ -268,6 +268,7 @@ func (c *Client) buildRequest(method string, body io.Reader) (*http.Request, err
func (c *Client) buildClient() http.Client {
client := http.Client{Timeout: time.Duration(c.ClientTimeout) * time.Second}
transport := &http.Transport{
+ Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
// Default is 30s.
Timeout: 10 * time.Second,