minipass-fetch
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -170,14 +170,18 @@ 'use strict' | ||
if (Minipass.isStream(body) && typeof body.getBoundary !== 'function') { | ||
// create a dedicated tee stream so that we don't lose data | ||
// potentially sitting in the body stream's buffer by writing it | ||
// immediately to p1 and not having it for p2. | ||
const tee = new Minipass() | ||
const p1 = new Minipass() | ||
const p2 = new Minipass() | ||
body.pause() | ||
body.on('error', er => { | ||
tee.on('error', er => { | ||
p1.emit('error', er) | ||
p2.emit('error', er) | ||
}) | ||
body.pipe(p1) | ||
body.pipe(p2) | ||
body.on('error', er => tee.emit('error', er)) | ||
tee.pipe(p1) | ||
tee.pipe(p2) | ||
body.pipe(tee) | ||
// set instance body to one fork, return the other | ||
instance[INTERNALS].body = p1 | ||
body.resume() | ||
return p2 | ||
@@ -184,0 +188,0 @@ } else |
{ | ||
"name": "minipass-fetch", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "An implementation of window.fetch in Node.js using Minipass streams", | ||
@@ -29,3 +29,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"minipass": "^2.8.4", | ||
"minipass": "^2.8.6", | ||
"minipass-pipeline": "^1.2.0", | ||
@@ -32,0 +32,0 @@ "minipass-sized": "^1.0.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39418
1088
Updatedminipass@^2.8.6