New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

express-form-post

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-form-post - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

19

lib/attachListeners.js

@@ -9,5 +9,3 @@ const hasha = require("hasha");

if(originalname == "" || req.efp._data[fieldname] != undefined || req.efp._finished) return file.resume();
req.efp._data[fieldname] = {
size: 0
};
req.efp._data[fieldname] = { size: 0 };

@@ -59,2 +57,5 @@ // Busboy emits limit event before my file listeners can reach it

});
file.on("error", (err) => this.handleError(err));
})

@@ -73,12 +74,16 @@ .catch((err) => {

busboy.on("error", (err) => this.handleError(err));
busboy.on("field", (fieldname, val, fieldnameTruncated, valTruncated) => {
// Possibly should add some handler for if a certain value was truncated
!valTruncated && !fieldnameTruncated ? req.body[fieldname] = val : "";
});
busboy.on("error", (err) => this.handleError(err));
busboy.on("partsLimit", () => this.handleError("parts limit reached"));
busboy.on("filesLimit", () => this.handleError("files limit reached"));
busboy.on("fieldsLimit", () => this.handleError("fields limit reached"));
busboy.on("finish", () => {
if(req.efp._finished) return; // handleError was called
req.efp.busboy._finished = true;
req.efp.busboy._finished = true;
new Promise((resolve, reject) => {

@@ -85,0 +90,0 @@ const handlePromise = (flag) => {

@@ -6,4 +6,9 @@ const Busboy = require("busboy");

if(req._body) return next();
var busboy = new Busboy({ headers: req.headers });
try {
var busboy = new Busboy({ headers: req.headers });
} catch(err) {
return next(err);
}
req._body = true;

@@ -22,2 +27,8 @@ req.body = {};

});
busboy.on("error", (err) => next(err));
busboy.on("partsLimit", () => next(new Error("parts limit reached")));
busboy.on("filesLimit", () => next(new Error("files limit reached")));
busboy.on("fieldsLimit", () => next(new Error("fields limit reached")));
busboy.on("finish", () => {

@@ -24,0 +35,0 @@ return next();

@@ -19,3 +19,4 @@ const Stream = require("stream");

}
});
});
pass.on("error", (err) => this.handleError(err));

@@ -34,6 +35,4 @@ let s3params = {

if(abort) {
uploadStream.abort.bind(uploadStream)().then(() => {
console.log("test");
});
delete req.efp._data[uploadInfo.fieldname].size;
uploadStream.abort.bind(uploadStream)();
delete req.efp._data[uploadInfo.fieldname];
}

@@ -40,0 +39,0 @@ });

@@ -15,4 +15,7 @@ const Stream = require("stream");

pass.on("error", (err) => this.handleError(err));
pass.pipe(writeStream);
pass.once("destroy", () => writeStream.emit("destroy"));
writeStream.on("error", (err) => this.handleError(err));
writeStream.once("finish", () => {

@@ -19,0 +22,0 @@ if(req.efp._finished) return; // when stream is to end and the file was deleted

@@ -11,2 +11,4 @@ const Stream = require("stream");

pass.on("error", (err) => this.handleError(err));
let up = db.createDropboxUploadStream({

@@ -13,0 +15,0 @@ token: this.apiObject.accessToken,

{
"name": "express-form-post",
"version": "1.1.0",
"version": "1.1.1",
"description": "Simple, reliable and memory efficient http file parse and upload api",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,3 +12,3 @@ # Express Form Post

Many bugs were addressed in ver 1.1.0, so please consider switching to the latest version or at least ver 1.1.0.
Many bugs were addressed in ver 1.1.0, so if you are using an older version please consider switching to the latest version.

@@ -15,0 +15,0 @@ ## Installation

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