express-form-post
Advanced tools
Comparing version 1.0.19 to 1.0.20
@@ -177,2 +177,3 @@ "use strict"; | ||
if(req.method == "POST") { | ||
if(req._body) return cb(); | ||
/* | ||
@@ -188,2 +189,3 @@ * _validate defaults to true and becomes false if the file being uploaded is not valid | ||
req.body = {}; | ||
req._body = true; // prevent multiple multipart middleware and body-parser from colliding | ||
req.files = {}; | ||
@@ -235,3 +237,2 @@ | ||
if(req._body) return this.finished(); | ||
try { | ||
@@ -238,0 +239,0 @@ var busboy = new Busboy({ |
@@ -5,4 +5,6 @@ const Busboy = require("busboy"); | ||
if(req.method == "POST" && req.headers["content-type"].includes("multipart")) { | ||
if(req._body) return next(); | ||
var busboy = new Busboy({ headers: req.headers }); | ||
req._body = true; | ||
req.body = {}; | ||
@@ -9,0 +11,0 @@ |
{ | ||
"name": "express-form-post", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"description": "Simple, reliable express http file and post body handler.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Express Form Post [![npm version](https://badge.fury.io/js/express-form-post.svg)](https://badge.fury.io/js/express-form-post) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) | ||
#### A simple solution to handling file and form submissions | ||
Note: this is not recommended for use by applications that handles large files or receives a large volume of file upload requests. This is a quick solution to any application that handle small to medium sized files. This is intended to be an abstraction for applications whose core doesn't come from file uploading. | ||
express-form-post was designed to become a central module primarily to abstract away setting up file uploads for dropbox and aws-s3 storage apis. Note: this is not recommended for use by applications that handles large files or receives a large volume of file upload requests. This is a quick solution to any application that handle small to medium sized files. This is intended to be an abstraction for applications whose core doesn't come from file uploading. | ||
@@ -6,0 +6,0 @@ ## Installation |
26037
430