Skip to content

Commit

Permalink
deps: minipass-fetch@2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nlf authored and lukekarrys committed Mar 28, 2022
1 parent feb4446 commit c33b533
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
6 changes: 4 additions & 2 deletions node_modules/minipass-fetch/lib/body.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
5 changes: 3 additions & 2 deletions node_modules/minipass-fetch/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -362,3 +362,4 @@ fetch.Headers = Headers
fetch.Request = Request
fetch.Response = Response
fetch.FetchError = FetchError
fetch.AbortError = AbortError
26 changes: 14 additions & 12 deletions node_modules/minipass-fetch/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -10,27 +10,28 @@
"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",
"form-data": "^4.0.0",
"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",
Expand All @@ -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",
Expand All @@ -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"
}
}
14 changes: 7 additions & 7 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -5053,17 +5053,17 @@
}
},
"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",
"minipass-sized": "^1.0.3",
"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"
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit c33b533

Please sign in to comment.