Skip to content

Commit 1a30dae

Browse files
committed
Check lower-cased proxy settings as well
1 parent 9dd700b commit 1a30dae

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/HttpClient.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ export class HttpClient implements ifm.IHttpClient {
125125
constructor(userAgent: string | null | undefined, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions) {
126126
this.userAgent = userAgent;
127127
this.handlers = handlers || [];
128-
let no_proxy: string = process.env[EnvironmentVariables.NO_PROXY];
128+
let no_proxy: string = process.env[EnvironmentVariables.NO_PROXY]
129+
if (!no_proxy) {
130+
no_proxy = process.env[EnvironmentVariables.NO_PROXY.toLowerCase()];
131+
}
129132
if (no_proxy) {
130133
this._httpProxyBypassHosts = [];
131134
no_proxy.split(',').forEach(bypass => {
@@ -552,7 +555,13 @@ export class HttpClient implements ifm.IHttpClient {
552555

553556
// fallback to http_proxy and https_proxy env
554557
let https_proxy: string = process.env[EnvironmentVariables.HTTPS_PROXY];
558+
if (!https_proxy) {
559+
https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY.toLowerCase()];
560+
}
555561
let http_proxy: string = process.env[EnvironmentVariables.HTTP_PROXY];
562+
if (!http_proxy) {
563+
http_proxy = process.env[EnvironmentVariables.HTTP_PROXY.toLowerCase()];
564+
}
556565

557566
if (!proxyConfig) {
558567
if (https_proxy && usingSsl) {

0 commit comments

Comments
 (0)