Skip to content

Commit

Permalink
Allow usage of HTTP_PROXY and HTTPS_PROXY.
Browse files Browse the repository at this point in the history
These variables are supported if the default `http.Client` and `http.Transport`
are used, but due to custom instances being used, the support is lost. This
commit manually adds it back.
  • Loading branch information
stevesg committed Oct 29, 2021
1 parent e355106 commit cbb45e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Order should be `CHANGE`, `FEATURE`, `ENHANCEMENT`, and `BUGFIX`

## unreleased

* [ENHANCEMENT] Allow usage of HTTP_PROXY and HTTPS_PROXY. #

## v0.10.4

* [CHANGE] Update go image to v1.16.8. #213
Expand Down
5 changes: 4 additions & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ func New(cfg Config) (*CortexClient, error) {
}

if tlsConfig != nil {
transport := &http.Transport{TLSClientConfig: tlsConfig}
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: tlsConfig,
}
client = http.Client{Transport: transport}
}

Expand Down

0 comments on commit cbb45e6

Please sign in to comment.