Skip to content

Commit cd7faa3

Browse files
committed
fix: respect proxy env vars in anonymous http client
The anonymous HTTP client was using a bare `http.Transport{}` which does not respect `HTTP_PROXY`/`HTTPS_PROXY` environment variables. This change clones `http.DefaultTransport` instead, which has `Proxy: http.ProxyFromEnvironment` set by default. Related to #1509 Signed-off-by: Diogo Correia <diogo.correia@siemens.com>
1 parent 94f71cf commit cd7faa3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

github/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (c *Config) Anonymous() bool {
8787
}
8888

8989
func (c *Config) AnonymousHTTPClient() *http.Client {
90-
client := &http.Client{Transport: &http.Transport{}}
90+
client := &http.Client{Transport: http.DefaultTransport.(*http.Transport).Clone()}
9191
return RateLimitedHTTPClient(client, c.WriteDelay, c.ReadDelay, c.RetryDelay, c.ParallelRequests, c.RetryableErrors, c.MaxRetries)
9292
}
9393

0 commit comments

Comments
 (0)