body-parser
Advanced tools
Comparing version 1.8.4 to 1.9.0
@@ -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 @@ ================== |
@@ -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 |
@@ -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", |
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
29281
553
+ Addeddepd@1.0.1(transitive)
- Removeddepd@0.4.5(transitive)
Updateddepd@~1.0.0