Don't ignore BALENARC_NO_PROXY env var if HTTP(S)_PROXY env vars are defined

Change-type: patch
This commit is contained in:
Paulo Castro 2020-03-02 14:46:37 +00:00 committed by Pagan Gazzard
parent 00943463a4
commit 9470e804c0

View File

@ -147,6 +147,7 @@ async function setupGlobalTunnelNgProxy(proxy?: ProxyConfig) {
* `global-agent` proxy setup.
* See docs for setupGlobalHttpProxy() above, and also the README file
* (Proxy Support section).
* If `proxy` is undefined, HTTP(S)_PROXY env vars are expected to be set.
*/
async function setupGlobalAgentProxy(
settings: CliSettings,
@ -163,17 +164,16 @@ async function setupGlobalAgentProxy(
const env = process.env;
env.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE = '';
env.NO_PROXY = [
...requiredNoProxy,
...(noProxy ? noProxy.split(',').filter(v => v) : privateNoProxy),
].join(',');
if (proxy) {
const proxyUrl: string =
typeof proxy === 'string' ? proxy : makeUrlFromTunnelNgConfig(proxy);
env.HTTPS_PROXY = env.HTTP_PROXY = proxyUrl;
env.NO_PROXY = [
...requiredNoProxy,
...(noProxy ? noProxy.split(',').filter(v => v) : privateNoProxy),
].join(',');
}
const { bootstrap } = await import('global-agent');