From 13e0ce9cf78a70b1b17d7030b8ac33ab5aecdfab Mon Sep 17 00:00:00 2001 From: Tatyana Kostromskaya <32135588+takost@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:39:29 +0000 Subject: [PATCH] resolve comments --- packages/http-client/package-lock.json | 16 ++++++---------- packages/http-client/package.json | 6 +++--- packages/http-client/src/index.ts | 18 +++++++----------- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json index 8391d4f4..dc7a9bd8 100644 --- a/packages/http-client/package-lock.json +++ b/packages/http-client/package-lock.json @@ -1,29 +1,28 @@ { "name": "@actions/http-client", - "version": "3.0.0", + "version": "2.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/http-client", - "version": "3.0.0", + "version": "2.2.0", "license": "MIT", "dependencies": { - "tunnel": "^0.0.6" + "tunnel": "^0.0.6", + "undici": "^5.25.4" }, "devDependencies": { "@types/node": "20.7.1", "@types/proxy": "^1.0.1", "@types/tunnel": "0.0.3", - "proxy": "^2.1.1", - "undici": "^5.25.4" + "proxy": "^2.1.1" } }, "node_modules/@fastify/busboy": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", - "dev": true, "engines": { "node": ">=14" } @@ -220,7 +219,6 @@ "version": "5.25.4", "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz", "integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==", - "dev": true, "dependencies": { "@fastify/busboy": "^2.0.0" }, @@ -233,8 +231,7 @@ "@fastify/busboy": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", - "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", - "dev": true + "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==" }, "@types/node": { "version": "20.7.1", @@ -387,7 +384,6 @@ "version": "5.25.4", "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz", "integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==", - "dev": true, "requires": { "@fastify/busboy": "^2.0.0" } diff --git a/packages/http-client/package.json b/packages/http-client/package.json index 4f88f1f9..ed134372 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -1,6 +1,6 @@ { "name": "@actions/http-client", - "version": "3.0.0", + "version": "2.2.0", "description": "Actions Http Client", "keywords": [ "github", @@ -42,10 +42,10 @@ "@types/node": "20.7.1", "@types/tunnel": "0.0.3", "proxy": "^2.1.1", - "undici": "^5.25.4", "@types/proxy": "^1.0.1" }, "dependencies": { - "tunnel": "^0.0.6" + "tunnel": "^0.0.6", + "undici": "^5.25.4" } } diff --git a/packages/http-client/src/index.ts b/packages/http-client/src/index.ts index bfb90d73..f1170ea0 100644 --- a/packages/http-client/src/index.ts +++ b/packages/http-client/src/index.ts @@ -727,18 +727,14 @@ export class HttpClient { } const usingSsl = parsedUrl.protocol === 'https:' - - // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. - if (proxyUrl && proxyUrl.hostname) { - proxyAgent = new ProxyAgent({ - uri: proxyUrl.href, - pipelining: !this._keepAlive ? 0 : 1, - ...((proxyUrl.username || proxyUrl.password) && { - token: `${proxyUrl.username}:${proxyUrl.password}` - }) + proxyAgent = new ProxyAgent({ + uri: proxyUrl.href, + pipelining: !this._keepAlive ? 0 : 1, + ...((proxyUrl.username || proxyUrl.password) && { + token: `${proxyUrl.username}:${proxyUrl.password}` }) - this._proxyAgentDispatcher = proxyAgent - } + }) + this._proxyAgentDispatcher = proxyAgent if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process