Socket
Socket
Sign inDemoInstall

body-parser

Package Overview
Dependencies
Maintainers
6
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

body-parser - npm Package Compare versions

Comparing version 1.12.2 to 1.12.3

11

HISTORY.md

@@ -0,1 +1,12 @@

1.12.3 / 2015-04-15
===================
* Slight efficiency improvement when not debugging
* deps: depd@~1.0.1
* deps: iconv-lite@0.4.8
- Add encoding alias UNICODE-1-1-UTF-7
* deps: raw-body@1.3.4
- Fix hanging callback if request aborts during read
- deps: iconv-lite@0.4.8
1.12.2 / 2015-03-16

@@ -2,0 +13,0 @@ ===================

2

lib/types/json.js

@@ -99,3 +99,3 @@ /*!

debug('content-type %s', JSON.stringify(req.headers['content-type']))
debug('content-type %j', req.headers['content-type'])

@@ -102,0 +102,0 @@ // determine if request should be parsed

@@ -65,3 +65,3 @@ /*!

debug('content-type %s', JSON.stringify(req.headers['content-type']))
debug('content-type %j', req.headers['content-type'])

@@ -68,0 +68,0 @@ // determine if request should be parsed

@@ -67,3 +67,3 @@ /*!

debug('content-type %s', JSON.stringify(req.headers['content-type']))
debug('content-type %j', req.headers['content-type'])

@@ -70,0 +70,0 @@ // determine if request should be parsed

@@ -87,3 +87,3 @@ /*!

debug('content-type %s', JSON.stringify(req.headers['content-type']))
debug('content-type %j', req.headers['content-type'])

@@ -90,0 +90,0 @@ // determine if request should be parsed

{
"name": "body-parser",
"description": "Node.js body parsing middleware",
"version": "1.12.2",
"version": "1.12.3",
"contributors": [

@@ -15,13 +15,13 @@ "Douglas Christopher Wilson <doug@somethingdoug.com>",

"debug": "~2.1.3",
"depd": "~1.0.0",
"iconv-lite": "0.4.7",
"depd": "~1.0.1",
"iconv-lite": "0.4.8",
"on-finished": "~2.2.0",
"qs": "2.4.1",
"raw-body": "1.3.3",
"raw-body": "1.3.4",
"type-is": "~1.6.1"
},
"devDependencies": {
"istanbul": "0.3.8",
"istanbul": "0.3.9",
"methods": "~1.1.1",
"mocha": "~2.2.1",
"mocha": "~2.2.4",
"supertest": "~0.15.0"

@@ -28,0 +28,0 @@ },

@@ -46,2 +46,7 @@ # body-parser

The `bodyParser` object exposes various factories to create middlewares. All
middlewares will populate the `req.body` property with the parsed body or
provide an error to the callback. The various errors are described in the
[errors section](#errors).
### bodyParser.json(options)

@@ -254,2 +259,58 @@

## Errors
The middlewares provided by this module create errors depending on the error
condition during parsing. The errors will typically have a `status` property
that contains the suggested HTTP response code.
The following are the common errors emitted, though any error can come through
for various reasons.
### content encoding unsupported
This error will occur when the request had a `Content-Encoding` header that
contained an encoding but the "inflation" option was set to `false`. The
`status` property is set to `415`.
### request aborted
This error will occur when the request is aborted by the client before reading
the body has finished. The `received` property will be set to the number of
bytes received before the request was aborted and the `expected` property is
set to the number of expected bytes. The `status` property is set to `400`.
### request entity too large
This error will occur when the request body's size is larger than the "limit"
option. The `limit` property will be set to the byte limit and the `length`
property will be set to the request body's length. The `status` property is
set to `413`.
### request size did not match content length
This error will occur when the request's length did not match the length from
the `Content-Lentgh` header. This typically occurs when the requst is malformed,
typically when the `Content-Length` header was calculated based on characters
instead of bytes. The `status` property is set to `400`.
### stream encoding should not be set
This error will occur when something called the `req.setEncoding` method prior
to this middleware. This module operates directly on bytes only and you cannot
call `req.setEncoding` when using this module. The `status` property is set to
`500`.
### unsupported charset "BOGUS"
This error will occur when the request had a charset parameter in the
`Content-Type` header, but the `iconv-lite` module does not support it OR the
parser does not support it. The charset is contained in the message as well
as in the `charset` property. The `status` property is set to `415`.
### unsupported content encoding "bogus"
This error will occur when the request had a `Content-Encoding` header that
contained an unsupported encoding. The encoding is contained in the message
as well as in the `encoding` property. The `status` property is set to `415`.
## Examples

@@ -256,0 +317,0 @@

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