fix(core): request-rewriter proxy ignore loopback address and puppeteer ws endpoint (#15293)
This commit is contained in:
parent
b3eb3f3a0b
commit
8eccccc59c
|
|
@ -59,7 +59,14 @@ const getWrappedGet: <T extends Get>(origin: T) => T = (origin) =>
|
|||
if (!options.agent && proxy.agent) {
|
||||
const proxyRegex = new RegExp(proxy.proxyObj.url_regex);
|
||||
|
||||
if (proxyRegex.test(url.toString()) && url.protocol.startsWith('http') && url.host !== proxy.proxyUrlHandler?.host) {
|
||||
if (
|
||||
proxyRegex.test(url.toString()) &&
|
||||
url.protocol.startsWith('http') &&
|
||||
url.host !== proxy.proxyUrlHandler?.host &&
|
||||
url.host !== 'localhost' &&
|
||||
!url.host.startsWith('127.') &&
|
||||
!(config.puppeteerWSEndpoint?.includes(url.host) ?? false)
|
||||
) {
|
||||
options.agent = proxy.agent;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue