Skip to content

Commit dee8794

Browse files
committed
Accept both NO_PROXY and no_proxy for proxy detection on Linux
1 parent 557c1e5 commit dee8794

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/detect-proxy.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,21 @@ export async function getSystemProxyConfig(): Promise<ProxyConfig | undefined> {
4141
return undefined;
4242
}
4343
} else {
44-
const proxyUrl = process.env.HTTPS_PROXY ||
45-
process.env.HTTP_PROXY ||
46-
process.env.https_proxy ||
47-
process.env.http_proxy;
44+
const {
45+
HTTPS_PROXY,
46+
https_proxy,
47+
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;
4854

4955
if (!proxyUrl) return undefined;
5056

51-
const noProxy = process.env.NO_PROXY
52-
? process.env.NO_PROXY.split(',')
57+
const noProxy = !!(NO_PROXY || no_proxy)
58+
? (NO_PROXY || no_proxy)!.split(',')
5359
: undefined;
5460

5561
return {

0 commit comments

Comments
 (0)