Skip to content

Commit

Permalink
🧹 read proxy from HTTPS_PROXY env var (#4614)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev authored Aug 28, 2024
1 parent 483ba82 commit 7dee6bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/config/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"go.mondoo.com/ranger-rpc"
)

// GetAPIProxy returns the proxy URL from the environment variable MONDOO_API_PROXY and cli flag --api-proxy.
// GetAPIProxy returns the proxy URL from the environment variable MONDOO_API_PROXY, HTTPS_PROXY and cli flag --api-proxy.
// It should only be used when the options are not yet parsed, see CommonCliConfig.GetAPIProxy().
func GetAPIProxy() (*url.URL, error) {
proxy, envSet := os.LookupEnv("MONDOO_API_PROXY")
Expand All @@ -25,6 +25,11 @@ func GetAPIProxy() (*url.URL, error) {
return url.Parse(proxy)
}

proxy, envSet = os.LookupEnv("HTTPS_PROXY")
if envSet {
return url.Parse(proxy)
}

return nil, nil
}

Expand Down

0 comments on commit 7dee6bd

Please sign in to comment.