* @param {ProxyConfig} proxyConfig * @param {object} reqOptions * @returns {boolean}
(proxyConfig, reqOptions)
| 237 | * @returns {boolean} |
| 238 | */ |
| 239 | function checkShouldUseProxy(proxyConfig, reqOptions) { |
| 240 | if (!proxyConfig) { |
| 241 | return false; |
| 242 | } |
| 243 | if (reqOptions.socketPath) { |
| 244 | // If socketPath is set, the endpoint is a Unix domain socket, which can't |
| 245 | // be proxied. |
| 246 | return false; |
| 247 | } |
| 248 | return proxyConfig.shouldUseProxy(reqOptions.host || 'localhost', reqOptions.port); |
| 249 | } |
| 250 | |
| 251 | function filterEnvForProxies(env) { |
| 252 | return { |
no test coverage detected
searching dependent graphs…