Skip to content

Commit

Permalink
🧹 read proxy from HTTPS_PROXY env var
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
  • Loading branch information
imilchev committed Aug 28, 2024
1 parent 483ba82 commit 46918e9
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 46918e9

Please sign in to comment.