Socket
Socket
Sign inDemoInstall

minipass-fetch

Package Overview
Dependencies
9
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

14

lib/body.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc