Revert "Bypass proxy on loopback IPs"

This reverts commit 8d92c9c903.
This commit is contained in:
Ferenc Hammerl
2023-03-01 13:48:44 +00:00
parent 8d92c9c903
commit 1f4b3fac06
2 changed files with 8 additions and 28 deletions

View File

@@ -25,11 +25,6 @@ export function checkBypass(reqUrl: URL): boolean {
return false
}
const reqHost = reqUrl.hostname
if (isLoopbackAddress(reqHost)) {
return true
}
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''
if (!noProxy) {
return false
@@ -71,8 +66,3 @@ export function checkBypass(reqUrl: URL): boolean {
return false
}
function isLoopbackAddress(host: string): boolean {
const hostUpper = host.toUpperCase()
return hostUpper === 'LOCALHOST' || hostUpper.startsWith('127.') || hostUpper.startsWith('::1')
}