( hostname: string, requestOptions: RequestOptions | undefined, )
| 94 | * @returns True if the hostname should bypass proxy |
| 95 | */ |
| 96 | export function shouldBypassProxy( |
| 97 | hostname: string, |
| 98 | requestOptions: RequestOptions | undefined, |
| 99 | ): boolean { |
| 100 | const ignores = [ |
| 101 | ...getEnvNoProxyPatterns(), |
| 102 | ...getReqOptionsNoProxyPatterns(requestOptions), |
| 103 | ]; |
| 104 | const hostLowerCase = hostname.toLowerCase(); |
| 105 | return ignores.some((ignore) => |
| 106 | patternMatchesHostname(hostLowerCase, ignore), |
| 107 | ); |
| 108 | } |
no test coverage detected