Reverted the update
Some checks failed
Auto Maintenance Cycle / pre-commit Autoupdate (push) Failing after 31s

This commit is contained in:
2024-05-21 02:29:28 +02:00
parent 5677567dc9
commit d1250e341b
37 changed files with 312 additions and 778 deletions

View File

@ -502,7 +502,7 @@ class HttpClient {
if (this._keepAlive && useProxy) {
agent = this._proxyAgent;
}
if (!useProxy) {
if (this._keepAlive && !useProxy) {
agent = this._agent;
}
// if agent is already assigned use that agent.
@ -534,12 +534,16 @@ class HttpClient {
agent = tunnelAgent(agentOptions);
this._proxyAgent = agent;
}
// if tunneling agent isn't assigned create a new agent
if (!agent) {
// if reusing agent across request and tunneling agent isn't assigned create a new agent
if (this._keepAlive && !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

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "@actions/http-client",
"version": "2.2.1",
"version": "2.2.0",
"description": "Actions Http Client",
"keywords": [
"github",
@ -48,4 +48,4 @@
"tunnel": "^0.0.6",
"undici": "^5.25.4"
}
}
}