Socket
Socket
Sign inDemoInstall

body-parser

Package Overview
Dependencies
11
Maintainers
6
Versions
72
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.7.0 to 1.8.0

13

HISTORY.md

@@ -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 @@ ==================

7

lib/types/json.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc