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.8.4 to 1.9.0

7

HISTORY.md

@@ -0,1 +1,8 @@

1.9.0 / 2014-09-24
==================
* include the charset in "unsupported charset" error message
* include the encoding in "unsupported content encoding" error message
* deps: depd@~1.0.0
1.8.4 / 2014-09-23

@@ -2,0 +9,0 @@ ==================

10

lib/read.js

@@ -68,2 +68,9 @@ /*!

// echo back charset
if (err.type === 'encoding.unsupported') {
err = new Error('unsupported charset "' + encoding.toUpperCase() + '"')
err.charset = encoding.toLowerCase()
err.status = 415
}
// read off entire request

@@ -140,3 +147,4 @@ stream.resume()

default:
err = new Error('unsupported content encoding')
err = new Error('unsupported content encoding "' + encoding + '"')
err.encoding = encoding
err.status = 415

@@ -143,0 +151,0 @@ throw err

7

lib/types/json.js

@@ -78,5 +78,6 @@ /*!

// RFC 7159 sec 8.1
var charset = typer.parse(req).parameters.charset || 'utf-8'
if (charset.substr(0, 4).toLowerCase() !== 'utf-') {
var err = new Error('unsupported charset')
var charset = (typer.parse(req).parameters.charset || 'utf-8').toLowerCase()
if (charset.substr(0, 4) !== 'utf-') {
var err = new Error('unsupported charset "' + charset.toUpperCase() + '"')
err.charset = charset
err.status = 415

@@ -83,0 +84,0 @@ next(err)

@@ -74,5 +74,6 @@ /*!

var charset = typer.parse(req).parameters.charset || 'utf-8'
if (charset.toLowerCase() !== 'utf-8') {
var err = new Error('unsupported charset')
var charset = (typer.parse(req).parameters.charset || 'utf-8').toLowerCase()
if (charset !== 'utf-8') {
var err = new Error('unsupported charset "' + charset.toUpperCase() + '"')
err.charset = charset
err.status = 415

@@ -79,0 +80,0 @@ next(err)

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

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

"bytes": "1.0.0",
"depd": "0.4.5",
"depd": "~1.0.0",
"iconv-lite": "0.4.4",

@@ -16,0 +16,0 @@ "media-typer": "0.3.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