Skip to content

Commit

Permalink
Fix modify http.DefaultTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
septs committed Sep 27, 2023
1 parent d59eda7 commit b2bd25e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/geoipupdate/database/http_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ func NewHTTPReader(
retryFor time.Duration,
verbose bool,
) Reader {
transport := http.DefaultTransport
transport := &http.Transport{Proxy: http.ProxyFromEnvironment}
if proxy != nil {
proxyFunc := http.ProxyURL(proxy)
transport.(*http.Transport).Proxy = proxyFunc
transport.Proxy = http.ProxyURL(proxy)
}

return &HTTPReader{
Expand Down

0 comments on commit b2bd25e

Please sign in to comment.