fetcher: respect HTTP(S)_PROXY environment variable (#2635)

This commit is contained in:
Moritz Sanft 2023-11-23 14:42:13 +01:00 committed by GitHub
parent d599b80b2a
commit c922864f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,10 @@ import (
// NewHTTPClient returns a new http client.
func NewHTTPClient() HTTPClient {
return &http.Client{Transport: &http.Transport{DisableKeepAlives: true}} // DisableKeepAlives fixes concurrency issue see https://stackoverflow.com/a/75816347
return &http.Client{Transport: &http.Transport{
DisableKeepAlives: true, // DisableKeepAlives fixes concurrency issue see https://stackoverflow.com/a/75816347
Proxy: http.ProxyFromEnvironment,
}}
}
// Fetch fetches the given apiObject from the public Constellation CDN.