Skip to content

Commit c33b533

Browse files
nlflukekarrys
authored andcommitted
1 parent feb4446 commit c33b533

File tree

4 files changed

+28
-23
lines changed

4 files changed

+28
-23
lines changed

node_modules/minipass-fetch/lib/body.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ class Body {
127127
: this.size ? new MinipassSized({ size: this.size })
128128
: new Minipass()
129129

130-
// allow timeout on slow response body
131-
const resTimeout = this.timeout ? setTimeout(() => {
130+
// allow timeout on slow response body, but only if the stream is still writable. this
131+
// makes the timeout center on the socket stream from lib/index.js rather than the
132+
// intermediary minipass stream we create to receive the data
133+
const resTimeout = this.timeout && stream.writable ? setTimeout(() => {
132134
stream.emit('error', new FetchError(
133135
`Response timeout while trying to fetch ${
134136
this.url} (over ${this.timeout}ms)`, 'body-timeout'))

node_modules/minipass-fetch/lib/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ const fetch = async (url, opts) => {
255255
size: request.size,
256256
timeout: request.timeout,
257257
counter: request.counter,
258-
trailer: new Promise(resolve =>
259-
res.on('end', () => resolve(createHeadersLenient(res.trailers)))),
258+
trailer: new Promise(resolveTrailer =>
259+
res.on('end', () => resolveTrailer(createHeadersLenient(res.trailers)))),
260260
}
261261

262262
// HTTP-network fetch step 12.1.1.3
@@ -362,3 +362,4 @@ fetch.Headers = Headers
362362
fetch.Request = Request
363363
fetch.Response = Response
364364
fetch.FetchError = FetchError
365+
fetch.AbortError = AbortError
+14-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "minipass-fetch",
3-
"version": "2.0.3",
3+
"version": "2.1.0",
44
"description": "An implementation of window.fetch in Node.js using Minipass streams",
55
"license": "MIT",
66
"main": "lib/index.js",
@@ -10,27 +10,28 @@
1010
"preversion": "npm test",
1111
"postversion": "npm publish",
1212
"postpublish": "git push origin --follow-tags",
13-
"lint": "eslint '**/*.js'",
14-
"postlint": "npm-template-check",
15-
"template-copy": "npm-template-copy --force",
13+
"lint": "eslint \"**/*.js\"",
14+
"postlint": "template-oss-check",
1615
"lintfix": "npm run lint -- --fix",
1716
"prepublishOnly": "git push origin --follow-tags",
18-
"posttest": "npm run lint"
17+
"posttest": "npm run lint",
18+
"template-oss-apply": "template-oss-apply --force"
1919
},
2020
"tap": {
2121
"coverage-map": "map.js",
2222
"check-coverage": true
2323
},
2424
"devDependencies": {
25-
"@npmcli/template-oss": "^2.9.2",
25+
"@npmcli/eslint-config": "^3.0.1",
26+
"@npmcli/template-oss": "3.1.2",
2627
"@ungap/url-search-params": "^0.2.2",
2728
"abort-controller": "^3.0.0",
2829
"abortcontroller-polyfill": "~1.7.3",
2930
"form-data": "^4.0.0",
3031
"nock": "^13.2.4",
3132
"parted": "^0.1.1",
3233
"string-to-arraybuffer": "^1.0.2",
33-
"tap": "^15.1.6"
34+
"tap": "^16.0.0"
3435
},
3536
"dependencies": {
3637
"minipass": "^3.1.6",
@@ -42,7 +43,7 @@
4243
},
4344
"repository": {
4445
"type": "git",
45-
"url": "git+https://github.com/npm/minipass-fetch.git"
46+
"url": "https://github.com/npm/minipass-fetch.git"
4647
},
4748
"keywords": [
4849
"fetch",
@@ -51,14 +52,15 @@
5152
"window.fetch"
5253
],
5354
"files": [
54-
"bin",
55-
"lib"
55+
"bin/",
56+
"lib/"
5657
],
5758
"engines": {
58-
"node": "^12.13.0 || ^14.15.0 || >=16"
59+
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
5960
},
6061
"author": "GitHub Inc.",
6162
"templateOSS": {
62-
"version": "2.9.2"
63+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
64+
"version": "3.1.2"
6365
}
6466
}

package-lock.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -5053,17 +5053,17 @@
50535053
}
50545054
},
50555055
"node_modules/minipass-fetch": {
5056-
"version": "2.0.3",
5057-
"resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.0.3.tgz",
5058-
"integrity": "sha512-VA+eiiUtaIvpQJXISwE3OiMvQwAWrgKb97F0aXlCS1Ahikr8fEQq8m3Hf7Kv9KT3nokuHigJKsDMB6atU04olQ==",
5056+
"version": "2.1.0",
5057+
"resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz",
5058+
"integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==",
50595059
"inBundle": true,
50605060
"dependencies": {
50615061
"minipass": "^3.1.6",
50625062
"minipass-sized": "^1.0.3",
50635063
"minizlib": "^2.1.2"
50645064
},
50655065
"engines": {
5066-
"node": "^12.13.0 || ^14.15.0 || >=16"
5066+
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
50675067
},
50685068
"optionalDependencies": {
50695069
"encoding": "^0.1.13"
@@ -14611,9 +14611,9 @@
1461114611
}
1461214612
},
1461314613
"minipass-fetch": {
14614-
"version": "2.0.3",
14615-
"resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.0.3.tgz",
14616-
"integrity": "sha512-VA+eiiUtaIvpQJXISwE3OiMvQwAWrgKb97F0aXlCS1Ahikr8fEQq8m3Hf7Kv9KT3nokuHigJKsDMB6atU04olQ==",
14614+
"version": "2.1.0",
14615+
"resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz",
14616+
"integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==",
1461714617
"requires": {
1461814618
"encoding": "^0.1.13",
1461914619
"minipass": "^3.1.6",

0 commit comments

Comments
 (0)