body-parser
Advanced tools
Comparing version 1.6.4 to 1.6.5
@@ -0,1 +1,6 @@ | ||
1.6.5 / 2014-08-16 | ||
================== | ||
* deps: on-finished@2.1.0 | ||
1.6.4 / 2014-08-14 | ||
@@ -2,0 +7,0 @@ ================== |
@@ -13,2 +13,3 @@ /*! | ||
var iconv = require('iconv-lite') | ||
var onFinished = require('on-finished') | ||
var typer = require('media-typer') | ||
@@ -37,3 +38,2 @@ var zlib = require('zlib') | ||
var stream | ||
var waitend = true | ||
@@ -63,12 +63,12 @@ // flag as parsed | ||
req.on('aborted', cleanup) | ||
req.on('end', cleanup) | ||
req.on('error', cleanup) | ||
// read body | ||
getBody(stream, options, function (err, body) { | ||
if (err && waitend && req.readable) { | ||
if (err) { | ||
if (!err.status) { | ||
err.status = 400 | ||
} | ||
// read off entire request | ||
req.resume() | ||
req.once('end', function onEnd() { | ||
stream.resume() | ||
onFinished(req, function onfinished() { | ||
next(err) | ||
@@ -79,8 +79,2 @@ }) | ||
if (err) { | ||
if (!err.status) err.status = 400 | ||
next(err) | ||
return | ||
} | ||
// verify | ||
@@ -110,9 +104,2 @@ if (verify) { | ||
}) | ||
function cleanup() { | ||
waitend = false | ||
req.removeListener('aborted', cleanup) | ||
req.removeListener('end', cleanup) | ||
req.removeListener('error', cleanup) | ||
} | ||
} | ||
@@ -119,0 +106,0 @@ |
{ | ||
"name": "body-parser", | ||
"description": "Node.js body parsing middleware", | ||
"version": "1.6.4", | ||
"version": "1.6.5", | ||
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", | ||
@@ -16,2 +16,3 @@ "contributors": [ | ||
"media-typer": "0.2.0", | ||
"on-finished": "2.1.0", | ||
"qs": "1.2.2", | ||
@@ -18,0 +19,0 @@ "raw-body": "1.3.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23149
8
465
+ Addedon-finished@2.1.0
+ Addedee-first@1.0.5(transitive)
+ Addedon-finished@2.1.0(transitive)