From 6f071eb0787faeda1b0bdf6a301553d4266bed33 Mon Sep 17 00:00:00 2001 From: Diogo Correia Date: Thu, 9 Apr 2026 12:06:36 +0100 Subject: [PATCH] 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 --- github/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/config.go b/github/config.go index 521384e97d..a24c643d28 100644 --- a/github/config.go +++ b/github/config.go @@ -87,7 +87,7 @@ func (c *Config) Anonymous() bool { } func (c *Config) AnonymousHTTPClient() *http.Client { - client := &http.Client{Transport: &http.Transport{}} + client := &http.Client{Transport: http.DefaultTransport.(*http.Transport).Clone()} return RateLimitedHTTPClient(client, c.WriteDelay, c.ReadDelay, c.RetryDelay, c.ParallelRequests, c.RetryableErrors, c.MaxRetries) }