manual tweaks

This commit is contained in:
Rob Herley 2023-12-06 17:10:39 -05:00
parent 931bdcf052
commit d9a12ec708
No known key found for this signature in database
GPG Key ID: D1602042C3543B06
1 changed files with 4 additions and 7 deletions

9
dist/index.js vendored
View File

@ -142505,7 +142505,7 @@ class HttpClient {
if (this._keepAlive && useProxy) {
agent = this._proxyAgent;
}
if (this._keepAlive && !useProxy) {
if (!useProxy) {
agent = this._agent;
}
// if agent is already assigned use that agent.
@ -142538,15 +142538,12 @@ class HttpClient {
this._proxyAgent = agent;
}
// if reusing agent across request and tunneling agent isn't assigned create a new agent
if (this._keepAlive && !agent) {
if (!agent) {
const options = { keepAlive: this._keepAlive, maxSockets };
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
this._agent = agent;
}
// if not using private agent and tunnel agent isn't setup then use global agent
if (!agent) {
agent = usingSsl ? https.globalAgent : http.globalAgent;
}
if (usingSsl && this._ignoreSslError) {
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options