@@ -3218,6 +3218,10 @@ function checkBypass(reqUrl) {
32183218 if (!reqUrl.hostname) {
32193219 return false;
32203220 }
3221+ const reqHost = reqUrl.hostname;
3222+ if (isLoopbackAddress(reqHost)) {
3223+ return true;
3224+ }
32213225 const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
32223226 if (!noProxy) {
32233227 return false;
@@ -3243,13 +3247,24 @@ function checkBypass(reqUrl) {
32433247 .split(',')
32443248 .map(x => x.trim().toUpperCase())
32453249 .filter(x => x)) {
3246- if (upperReqHosts.some(x => x === upperNoProxyItem)) {
3250+ if (upperNoProxyItem === '*' ||
3251+ upperReqHosts.some(x => x === upperNoProxyItem ||
3252+ x.endsWith(`.${upperNoProxyItem}`) ||
3253+ (upperNoProxyItem.startsWith('.') &&
3254+ x.endsWith(`${upperNoProxyItem}`)))) {
32473255 return true;
32483256 }
32493257 }
32503258 return false;
32513259}
32523260exports.checkBypass = checkBypass;
3261+ function isLoopbackAddress(host) {
3262+ const hostLower = host.toLowerCase();
3263+ return (hostLower === 'localhost' ||
3264+ hostLower.startsWith('127.') ||
3265+ hostLower.startsWith('[::1]') ||
3266+ hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
3267+ }
32533268//# sourceMappingURL=proxy.js.map
32543269
32553270/***/ }),
@@ -6582,6 +6597,10 @@ function checkBypass(reqUrl) {
65826597 if (!reqUrl.hostname) {
65836598 return false;
65846599 }
6600+ const reqHost = reqUrl.hostname;
6601+ if (isLoopbackAddress(reqHost)) {
6602+ return true;
6603+ }
65856604 const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
65866605 if (!noProxy) {
65876606 return false;
@@ -6607,13 +6626,24 @@ function checkBypass(reqUrl) {
66076626 .split(',')
66086627 .map(x => x.trim().toUpperCase())
66096628 .filter(x => x)) {
6610- if (upperReqHosts.some(x => x === upperNoProxyItem)) {
6629+ if (upperNoProxyItem === '*' ||
6630+ upperReqHosts.some(x => x === upperNoProxyItem ||
6631+ x.endsWith(`.${upperNoProxyItem}`) ||
6632+ (upperNoProxyItem.startsWith('.') &&
6633+ x.endsWith(`${upperNoProxyItem}`)))) {
66116634 return true;
66126635 }
66136636 }
66146637 return false;
66156638}
66166639exports.checkBypass = checkBypass;
6640+ function isLoopbackAddress(host) {
6641+ const hostLower = host.toLowerCase();
6642+ return (hostLower === 'localhost' ||
6643+ hostLower.startsWith('127.') ||
6644+ hostLower.startsWith('[::1]') ||
6645+ hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
6646+ }
66176647//# sourceMappingURL=proxy.js.map
66186648
66196649/***/ }),
0 commit comments