Socket
Socket
Sign inDemoInstall

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 4.1.4 to 4.2.0

10

CHANGELOG.md

@@ -0,1 +1,11 @@

### 4.2.0
* Douglas Christopher Wilson:
- Use http-errors for raised errors
- Use random-bytes module for polyfill
- perf: remove parameter reassignment
* Graham Hunter
- examples: update placement of response in azureblobstorage
### 4.1.4

@@ -2,0 +12,0 @@

50

index.js

@@ -11,6 +11,7 @@ /*!

var createError = require('http-errors')
var randomBytes = require('random-bytes')
var stream = require('stream');
var util = require('util');
var fs = require('fs');
var crypto = require('crypto');
var path = require('path');

@@ -55,17 +56,16 @@ var os = require('os');

function Form(options) {
var opts = options || {}
var self = this;
stream.Writable.call(self);
options = options || {};
self.error = null;
self.autoFields = !!options.autoFields;
self.autoFiles = !!options.autoFiles;
self.autoFields = !!opts.autoFields
self.autoFiles = !!opts.autoFiles
self.maxFields = options.maxFields || 1000;
self.maxFieldsSize = options.maxFieldsSize || 2 * 1024 * 1024;
self.maxFilesSize = options.maxFilesSize || Infinity;
self.uploadDir = options.uploadDir || os.tmpdir();
self.encoding = options.encoding || 'utf8';
self.maxFields = opts.maxFields || 1000
self.maxFieldsSize = opts.maxFieldsSize || 2 * 1024 * 1024
self.maxFilesSize = opts.maxFilesSize || Infinity
self.uploadDir = opts.uploadDir || os.tmpdir()
self.encoding = opts.encoding || 'utf8'

@@ -658,7 +658,7 @@ self.bytesReceived = 0;

headers: fileStream.headers,
size: 0,
size: 0
};
var internalFile = {
publicFile: publicFile,
ws: null,
ws: null
};

@@ -685,7 +685,5 @@ beginFlush(self); // flush to write stream

internalFile.ws.on('error', function(err) {
if (err.code === 'ETOOBIG') {
err = createError(413, err.message);
err.code = 'ETOOBIG';
}
self.handleError(err);
self.handleError(err.code === 'ETOOBIG'
? createError(413, err.message, { code: err.code })
: err)
});

@@ -781,3 +779,3 @@ internalFile.ws.on('progress', function() {

function randoString(size) {
return rando(size).toString('base64').replace(/[\/\+]/g, function(x) {
return randomBytes.sync(size).toString('base64').replace(/[\/\+]/g, function(x) {
return b64Safe[x];

@@ -787,10 +785,2 @@ });

function rando(size) {
try {
return crypto.randomBytes(size);
} catch (err) {
return crypto.pseudoRandomBytes(size);
}
}
function parseFilename(headerValue) {

@@ -819,9 +809,1 @@ var m = headerValue.match(/\bfilename="(.*?)"($|; )/i);

}
function createError(status, message) {
var error = new Error(message);
Error.captureStackTrace(error, createError);
error.status = status;
error.statusCode = status;
return error;
}
{
"name": "multiparty",
"description": "multipart/form-data parser which supports streaming",
"version": "4.1.4",
"version": "4.2.0",
"author": "Andrew Kelley <superjoe30@gmail.com>",

@@ -21,2 +21,4 @@ "contributors": [

"fd-slicer": "~1.0.1",
"http-errors": "~1.6.3",
"random-bytes": "~1.0.0",
"safe-buffer": "5.1.2"

@@ -23,0 +25,0 @@ },

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