Skip to content

Commit 7fc5f08

Browse files
committed
chore: Update dist
1 parent ffc08ea commit 7fc5f08

File tree

2 files changed

+50
-20
lines changed

2 files changed

+50
-20
lines changed

dist/cleanup/index.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,10 @@ function checkBypass(reqUrl) {
17691769
if (!reqUrl.hostname) {
17701770
return false;
17711771
}
1772+
const reqHost = reqUrl.hostname;
1773+
if (isLoopbackAddress(reqHost)) {
1774+
return true;
1775+
}
17721776
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
17731777
if (!noProxy) {
17741778
return false;
@@ -1794,13 +1798,24 @@ function checkBypass(reqUrl) {
17941798
.split(',')
17951799
.map(x => x.trim().toUpperCase())
17961800
.filter(x => x)) {
1797-
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
1801+
if (upperNoProxyItem === '*' ||
1802+
upperReqHosts.some(x => x === upperNoProxyItem ||
1803+
x.endsWith(`.${upperNoProxyItem}`) ||
1804+
(upperNoProxyItem.startsWith('.') &&
1805+
x.endsWith(`${upperNoProxyItem}`)))) {
17981806
return true;
17991807
}
18001808
}
18011809
return false;
18021810
}
18031811
exports.checkBypass = checkBypass;
1812+
function isLoopbackAddress(host) {
1813+
const hostLower = host.toLowerCase();
1814+
return (hostLower === 'localhost' ||
1815+
hostLower.startsWith('127.') ||
1816+
hostLower.startsWith('[::1]') ||
1817+
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
1818+
}
18041819
//# sourceMappingURL=proxy.js.map
18051820

18061821
/***/ }),

0 commit comments

Comments
 (0)