(request3, cachedAgents, proxyUrl)
| 76297 | if (settings.username) { |
| 76298 | parsedProxyUrl.username = settings.username; |
| 76299 | } |
| 76300 | if (settings.password) { |
| 76301 | parsedProxyUrl.password = settings.password; |
| 76302 | } |
| 76303 | return parsedProxyUrl; |
| 76304 | } |
| 76305 | function setProxyAgentOnRequest(request3, cachedAgents, proxyUrl) { |
| 76306 | if (request3.agent) { |
| 76307 | return; |
| 76308 | } |
| 76309 | const url2 = new URL(request3.url); |
| 76310 | const isInsecure = url2.protocol !== "https:"; |
| 76311 | if (request3.tlsSettings) { |
| 76312 | logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored."); |
| 76313 | } |
| 76314 | const headers = request3.headers.toJSON(); |
| 76315 | if (isInsecure) { |
| 76316 | if (!cachedAgents.httpProxyAgent) { |
| 76317 | cachedAgents.httpProxyAgent = new import_http_proxy_agent.HttpProxyAgent(proxyUrl, { headers }); |
| 76318 | } |
| 76319 | request3.agent = cachedAgents.httpProxyAgent; |
| 76320 | } else { |
| 76321 | if (!cachedAgents.httpsProxyAgent) { |
| 76322 | cachedAgents.httpsProxyAgent = new import_https_proxy_agent2.HttpsProxyAgent(proxyUrl, { headers }); |
| 76323 | } |
no test coverage detected
searching dependent graphs…