From 7dee6bd537cb4a04c223a19394726fa8707171e6 Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Wed, 28 Aug 2024 12:18:07 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20read=20proxy=20from=20HTTPS=5FPR?= =?UTF-8?q?OXY=20env=20var=20(#4614)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ivan Milchev --- cli/config/proxy.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/config/proxy.go b/cli/config/proxy.go index ae53c3d04d..ada3133149 100644 --- a/cli/config/proxy.go +++ b/cli/config/proxy.go @@ -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") @@ -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 }