Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

multiparty

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multiparty - npm Package Compare versions

Comparing version 3.2.6 to 3.2.7

4

CHANGELOG.md

@@ -0,1 +1,5 @@

### 3.2.7
* Fix errors hanging responses in callback-style
### 3.2.6

@@ -2,0 +6,0 @@

35

index.js

@@ -83,3 +83,5 @@ exports.Form = Form;

Form.prototype.parse = function(req, cb) {
var called = false;
var self = this;
var waitend = true;

@@ -95,3 +97,7 @@ // if the user supplies a callback, this implies autoFields and autoFiles

req.on('error', handleError);
req.on('end', onReqEnd);
req.on('error', function(err) {
waitend = false;
handleError(err);
});
req.on('aborted', onReqAborted);

@@ -131,2 +137,15 @@

self.on('error', function(err) {
if (called) return;
called = true;
if (waitend && req.readable) {
// dump rest of request
req.resume();
req.once('end', function() {
cb(err);
});
return;
}
cb(err);

@@ -148,2 +167,3 @@ });

function onReqAborted() {
waitend = false;
self.emit('aborted');

@@ -153,2 +173,6 @@ handleError(new Error("Request aborted"));

function onReqEnd() {
waitend = false;
}
function handleError(err) {

@@ -159,8 +183,3 @@ var first = !self.error;

req.removeListener('aborted', onReqAborted);
// welp. 0.8 doesn't support unpipe, too bad so sad.
// let's drop support for 0.8 soon.
if (req.unpipe) {
req.unpipe(self);
}
req.removeListener('end', onReqEnd);
}

@@ -181,2 +200,4 @@

Form.prototype._write = function(buffer, encoding, cb) {
if (this.error) return;
var self = this

@@ -183,0 +204,0 @@ , i = 0

{
"name": "multiparty",
"version": "3.2.6",
"version": "3.2.7",
"description": "multipart/form-data parser which supports streaming",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc