body-parser
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -0,1 +1,14 @@ | ||
1.8.0 / 2014-09-05 | ||
================== | ||
* make empty-body-handling consistent between chunked requests | ||
- empty `json` produces `{}` | ||
- empty `raw` produces `new Buffer(0)` | ||
- empty `text` produces `''` | ||
- empty `urlencoded` produces `{}` | ||
* deps: qs@2.2.3 | ||
- Fix issue where first empty value in array is discarded | ||
* deps: type-is@~1.5.0 | ||
- fix `hasbody` to be true for `content-length: 0` | ||
1.7.0 / 2014-09-01 | ||
@@ -2,0 +15,0 @@ ================== |
@@ -54,4 +54,6 @@ /*! | ||
function parse(body) { | ||
if (0 === body.length) { | ||
throw new Error('invalid json, empty body') | ||
if (body.length === 0) { | ||
// special-case empty json body, as it's a common client-side mistake | ||
// TODO: maybe make this configurable or part of "strict" option | ||
return {} | ||
} | ||
@@ -105,5 +107,4 @@ | ||
function firstchar(str) { | ||
if (!str) return '' | ||
var match = firstcharRegExp.exec(str) | ||
return match ? match[1] : '' | ||
} |
{ | ||
"name": "body-parser", | ||
"description": "Node.js body parsing middleware", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"contributors": [ | ||
@@ -17,8 +17,8 @@ "Douglas Christopher Wilson <doug@somethingdoug.com>", | ||
"on-finished": "2.1.0", | ||
"qs": "2.2.2", | ||
"qs": "2.2.3", | ||
"raw-body": "1.3.0", | ||
"type-is": "~1.3.2" | ||
"type-is": "~1.5.0" | ||
}, | ||
"devDependencies": { | ||
"istanbul": "0.3.0", | ||
"istanbul": "0.3.2", | ||
"mocha": "~1.21.4", | ||
@@ -25,0 +25,0 @@ "should": "~4.0.4", |
26723
544
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmime-db@1.12.0(transitive)
+ Addedmime-types@2.0.14(transitive)
+ Addedqs@2.2.3(transitive)
+ Addedtype-is@1.5.7(transitive)
- Removedmime-types@1.0.2(transitive)
- Removedqs@2.2.2(transitive)
- Removedtype-is@1.3.2(transitive)
Updatedqs@2.2.3
Updatedtype-is@~1.5.0