From c33b5331120d8304e0f090ceda55e19cc6f451f4 Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 24 Mar 2022 10:06:47 -0700 Subject: [PATCH] deps: minipass-fetch@2.1.0 --- node_modules/minipass-fetch/lib/body.js | 6 ++++-- node_modules/minipass-fetch/lib/index.js | 5 +++-- node_modules/minipass-fetch/package.json | 26 +++++++++++++----------- package-lock.json | 14 ++++++------- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/node_modules/minipass-fetch/lib/body.js b/node_modules/minipass-fetch/lib/body.js index 2b8e3bd2f9e83..c7ffa5babcbc6 100644 --- a/node_modules/minipass-fetch/lib/body.js +++ b/node_modules/minipass-fetch/lib/body.js @@ -127,8 +127,10 @@ class Body { : this.size ? new MinipassSized({ size: this.size }) : new Minipass() - // allow timeout on slow response body - const resTimeout = this.timeout ? setTimeout(() => { + // allow timeout on slow response body, but only if the stream is still writable. this + // makes the timeout center on the socket stream from lib/index.js rather than the + // intermediary minipass stream we create to receive the data + const resTimeout = this.timeout && stream.writable ? setTimeout(() => { stream.emit('error', new FetchError( `Response timeout while trying to fetch ${ this.url} (over ${this.timeout}ms)`, 'body-timeout')) diff --git a/node_modules/minipass-fetch/lib/index.js b/node_modules/minipass-fetch/lib/index.js index 22257a417aff8..b1878ac0c06b5 100644 --- a/node_modules/minipass-fetch/lib/index.js +++ b/node_modules/minipass-fetch/lib/index.js @@ -255,8 +255,8 @@ const fetch = async (url, opts) => { size: request.size, timeout: request.timeout, counter: request.counter, - trailer: new Promise(resolve => - res.on('end', () => resolve(createHeadersLenient(res.trailers)))), + trailer: new Promise(resolveTrailer => + res.on('end', () => resolveTrailer(createHeadersLenient(res.trailers)))), } // HTTP-network fetch step 12.1.1.3 @@ -362,3 +362,4 @@ fetch.Headers = Headers fetch.Request = Request fetch.Response = Response fetch.FetchError = FetchError +fetch.AbortError = AbortError diff --git a/node_modules/minipass-fetch/package.json b/node_modules/minipass-fetch/package.json index 68e1ce134cd26..1f663b9245dea 100644 --- a/node_modules/minipass-fetch/package.json +++ b/node_modules/minipass-fetch/package.json @@ -1,6 +1,6 @@ { "name": "minipass-fetch", - "version": "2.0.3", + "version": "2.1.0", "description": "An implementation of window.fetch in Node.js using Minipass streams", "license": "MIT", "main": "lib/index.js", @@ -10,19 +10,20 @@ "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags", - "lint": "eslint '**/*.js'", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", "prepublishOnly": "git push origin --follow-tags", - "posttest": "npm run lint" + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force" }, "tap": { "coverage-map": "map.js", "check-coverage": true }, "devDependencies": { - "@npmcli/template-oss": "^2.9.2", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.1.2", "@ungap/url-search-params": "^0.2.2", "abort-controller": "^3.0.0", "abortcontroller-polyfill": "~1.7.3", @@ -30,7 +31,7 @@ "nock": "^13.2.4", "parted": "^0.1.1", "string-to-arraybuffer": "^1.0.2", - "tap": "^15.1.6" + "tap": "^16.0.0" }, "dependencies": { "minipass": "^3.1.6", @@ -42,7 +43,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/npm/minipass-fetch.git" + "url": "https://github.com/npm/minipass-fetch.git" }, "keywords": [ "fetch", @@ -51,14 +52,15 @@ "window.fetch" ], "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "author": "GitHub Inc.", "templateOSS": { - "version": "2.9.2" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.1.2" } } diff --git a/package-lock.json b/package-lock.json index e6674fdc51942..12db90cecb9dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5053,9 +5053,9 @@ } }, "node_modules/minipass-fetch": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.0.3.tgz", - "integrity": "sha512-VA+eiiUtaIvpQJXISwE3OiMvQwAWrgKb97F0aXlCS1Ahikr8fEQq8m3Hf7Kv9KT3nokuHigJKsDMB6atU04olQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz", + "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", "inBundle": true, "dependencies": { "minipass": "^3.1.6", @@ -5063,7 +5063,7 @@ "minizlib": "^2.1.2" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "optionalDependencies": { "encoding": "^0.1.13" @@ -14611,9 +14611,9 @@ } }, "minipass-fetch": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.0.3.tgz", - "integrity": "sha512-VA+eiiUtaIvpQJXISwE3OiMvQwAWrgKb97F0aXlCS1Ahikr8fEQq8m3Hf7Kv9KT3nokuHigJKsDMB6atU04olQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz", + "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", "requires": { "encoding": "^0.1.13", "minipass": "^3.1.6",