Skip to content

Commit

Permalink
Fixed the pipeline™
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterclaerhout committed Mar 11, 2024
1 parent 9be402b commit c8f65f7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,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.
Expand Down Expand Up @@ -2377,16 +2377,12 @@ class HttpClient {
agent = tunnelAgent(agentOptions);
this._proxyAgent = agent;
}
// if reusing agent across request and tunneling agent isn't assigned create a new agent
if (this._keepAlive && !agent) {
// if tunneling agent isn't assigned create a new 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
Expand Down

0 comments on commit c8f65f7

Please sign in to comment.