From 6afe126dce9094718848008c69099c06ef55af43 Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Fri, 11 Feb 2022 19:18:23 -0600 Subject: [PATCH] Upgrade node-fetch to 2.6.7 (cherry picked from commit 028b4a4ce811d854a2785de624f58e969ab44c98) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- ...tch+2.6.1.patch => node-fetch+2.6.7.patch} | 37 ++++++++++++------- yarn.lock | 25 +++++++++++++ 3 files changed, 49 insertions(+), 15 deletions(-) rename patches/{node-fetch+2.6.1.patch => node-fetch+2.6.7.patch} (72%) diff --git a/package.json b/package.json index d3b1a5468..344ae5c66 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "mkdirp": "0.5.2", "moment": "2.29.1", "mustache": "2.3.0", - "node-fetch": "2.6.1", + "node-fetch": "2.6.7", "node-forge": "0.10.0", "normalize-path": "3.0.0", "p-map": "2.1.0", diff --git a/patches/node-fetch+2.6.1.patch b/patches/node-fetch+2.6.7.patch similarity index 72% rename from patches/node-fetch+2.6.1.patch rename to patches/node-fetch+2.6.7.patch index 5539ff2d8..14f344240 100644 --- a/patches/node-fetch+2.6.1.patch +++ b/patches/node-fetch+2.6.7.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/node-fetch/lib/index.es.js b/node_modules/node-fetch/lib/index.es.js -index 61906c9..f09f5bd 100644 +index 4852f7c..ae9611f 100644 --- a/node_modules/node-fetch/lib/index.es.js +++ b/node_modules/node-fetch/lib/index.es.js -@@ -1231,6 +1231,9 @@ class Request { +@@ -1253,6 +1253,9 @@ class Request { this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; this.counter = init.counter || input.counter || 0; this.agent = init.agent || input.agent; @@ -12,7 +12,7 @@ index 61906c9..f09f5bd 100644 } get method() { -@@ -1350,7 +1353,7 @@ function getNodeRequestOptions(request) { +@@ -1372,7 +1375,7 @@ function getNodeRequestOptions(request) { method: request.method, headers: exportNodeCompatibleHeaders(headers), agent @@ -21,7 +21,7 @@ index 61906c9..f09f5bd 100644 } /** -@@ -1514,7 +1517,8 @@ function fetch(url, opts) { +@@ -1556,7 +1559,8 @@ function fetch(url, opts) { body: request.body, signal: request.signal, timeout: request.timeout, @@ -30,12 +30,12 @@ index 61906c9..f09f5bd 100644 + ca: request.ca, }; - // HTTP-redirect fetch step 9 + if (!isDomainOrSubdomain(request.url, locationURL)) { diff --git a/node_modules/node-fetch/lib/index.js b/node_modules/node-fetch/lib/index.js -index 4b241bf..23fa901 100644 +index e5b04f1..ed8d34a 100644 --- a/node_modules/node-fetch/lib/index.js +++ b/node_modules/node-fetch/lib/index.js -@@ -1235,6 +1235,9 @@ class Request { +@@ -1257,6 +1257,9 @@ class Request { this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; this.counter = init.counter || input.counter || 0; this.agent = init.agent || input.agent; @@ -45,7 +45,7 @@ index 4b241bf..23fa901 100644 } get method() { -@@ -1354,7 +1357,7 @@ function getNodeRequestOptions(request) { +@@ -1376,7 +1379,7 @@ function getNodeRequestOptions(request) { method: request.method, headers: exportNodeCompatibleHeaders(headers), agent @@ -54,7 +54,7 @@ index 4b241bf..23fa901 100644 } /** -@@ -1518,7 +1521,8 @@ function fetch(url, opts) { +@@ -1560,7 +1563,8 @@ function fetch(url, opts) { body: request.body, signal: request.signal, timeout: request.timeout, @@ -63,12 +63,12 @@ index 4b241bf..23fa901 100644 + ca: request.ca, }; - // HTTP-redirect fetch step 9 + if (!isDomainOrSubdomain(request.url, locationURL)) { diff --git a/node_modules/node-fetch/lib/index.mjs b/node_modules/node-fetch/lib/index.mjs -index ecf59af..b723a5c 100644 +index 49ee05e..bc639aa 100644 --- a/node_modules/node-fetch/lib/index.mjs +++ b/node_modules/node-fetch/lib/index.mjs -@@ -1229,6 +1229,9 @@ class Request { +@@ -1251,6 +1251,9 @@ class Request { this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; this.counter = init.counter || input.counter || 0; this.agent = init.agent || input.agent; @@ -78,7 +78,16 @@ index ecf59af..b723a5c 100644 } get method() { -@@ -1512,7 +1515,8 @@ function fetch(url, opts) { +@@ -1370,7 +1373,7 @@ function getNodeRequestOptions(request) { + method: request.method, + headers: exportNodeCompatibleHeaders(headers), + agent +- }); ++ }, request.ca ? { ca: request.ca } : {}); + } + + /** +@@ -1554,7 +1557,8 @@ function fetch(url, opts) { body: request.body, signal: request.signal, timeout: request.timeout, @@ -87,4 +96,4 @@ index ecf59af..b723a5c 100644 + ca: request.ca, }; - // HTTP-redirect fetch step 9 + if (!isDomainOrSubdomain(request.url, locationURL)) { diff --git a/yarn.lock b/yarn.lock index 28dd309c4..8a283e393 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10336,6 +10336,13 @@ node-fetch@2.6.1, node-fetch@^2.6.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== +node-fetch@2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" + node-fetch@^1.0.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" @@ -14451,6 +14458,11 @@ tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + trim-newlines@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" @@ -14981,6 +14993,11 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + webpack-cli@4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.6.0.tgz#27ae86bfaec0cf393fcfd58abdc5a229ad32fd16" @@ -15179,6 +15196,14 @@ whatwg-fetch@>=0.10.0: version "2.0.3" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"