We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 557c1e5 commit dee8794Copy full SHA for dee8794
1 file changed
src/detect-proxy.ts
@@ -41,15 +41,21 @@ export async function getSystemProxyConfig(): Promise<ProxyConfig | undefined> {
41
return undefined;
42
}
43
} else {
44
- const proxyUrl = process.env.HTTPS_PROXY ||
45
- process.env.HTTP_PROXY ||
46
- process.env.https_proxy ||
47
- process.env.http_proxy;
+ const {
+ HTTPS_PROXY,
+ https_proxy,
+ HTTP_PROXY,
48
+ http_proxy,
49
+ NO_PROXY,
50
+ no_proxy
51
+ } = process.env;
52
+
53
+ const proxyUrl = HTTPS_PROXY || HTTP_PROXY || https_proxy || http_proxy;
54
55
if (!proxyUrl) return undefined;
56
- const noProxy = process.env.NO_PROXY
- ? process.env.NO_PROXY.split(',')
57
+ const noProxy = !!(NO_PROXY || no_proxy)
58
+ ? (NO_PROXY || no_proxy)!.split(',')
59
: undefined;
60
61
return {
0 commit comments