🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

body-parser

Package Overview
Dependencies
Maintainers
4
Versions
84
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.20.5
to
1.20.6
+7
-1
HISTORY.md

@@ -0,4 +1,10 @@

1.20.6 / 2026-07-09
===================
* fix: improve `limit` option validation (#698)
* Invalid `limit` values (e.g. unparseable strings or `NaN`) now throw instead of being silently ignored, which previously disabled size limit enforcement
* `null` and `undefined` fall back to the default 100kb limit
1.20.5 / 2026-04-24
===================
* refactor(json): simplify strict mode error string construction
* refactor(json): simplify strict mode error string construction
* fix: extended urlencoded parsing of arrays with >100 elements (#716)

@@ -5,0 +11,0 @@ * deps: qs@~6.15.1

+7
-3

@@ -56,5 +56,5 @@ /*!

var limit = typeof opts.limit !== 'number'
? bytes.parse(opts.limit || '100kb')
: opts.limit
var limit = typeof opts.limit === 'undefined' || opts.limit === null
? 102400 // 100kb default
: bytes.parse(opts.limit)
var inflate = opts.inflate !== false

@@ -66,2 +66,6 @@ var reviver = opts.reviver

if (limit === null) {
throw new TypeError('option limit "' + String(opts.limit) + '" is invalid')
}
if (verify !== false && typeof verify !== 'function') {

@@ -68,0 +72,0 @@ throw new TypeError('option verify must be function')

@@ -36,8 +36,12 @@ /*!

var inflate = opts.inflate !== false
var limit = typeof opts.limit !== 'number'
? bytes.parse(opts.limit || '100kb')
: opts.limit
var limit = typeof opts.limit === 'undefined' || opts.limit === null
? 102400 // 100kb default
: bytes.parse(opts.limit)
var type = opts.type || 'application/octet-stream'
var verify = opts.verify || false
if (limit === null) {
throw new TypeError('option limit "' + String(opts.limit) + '" is invalid')
}
if (verify !== false && typeof verify !== 'function') {

@@ -44,0 +48,0 @@ throw new TypeError('option verify must be function')

@@ -38,8 +38,12 @@ /*!

var inflate = opts.inflate !== false
var limit = typeof opts.limit !== 'number'
? bytes.parse(opts.limit || '100kb')
: opts.limit
var limit = typeof opts.limit === 'undefined' || opts.limit === null
? 102400 // 100kb default
: bytes.parse(opts.limit)
var type = opts.type || 'text/plain'
var verify = opts.verify || false
if (limit === null) {
throw new TypeError('option limit "' + String(opts.limit) + '" is invalid')
}
if (verify !== false && typeof verify !== 'function') {

@@ -46,0 +50,0 @@ throw new TypeError('option verify must be function')

@@ -53,8 +53,12 @@ /*!

var inflate = opts.inflate !== false
var limit = typeof opts.limit !== 'number'
? bytes.parse(opts.limit || '100kb')
: opts.limit
var limit = typeof opts.limit === 'undefined' || opts.limit === null
? 102400 // 100kb default
: bytes.parse(opts.limit)
var type = opts.type || 'application/x-www-form-urlencoded'
var verify = opts.verify || false
if (limit === null) {
throw new TypeError('option limit "' + String(opts.limit) + '" is invalid')
}
if (verify !== false && typeof verify !== 'function') {

@@ -61,0 +65,0 @@ throw new TypeError('option verify must be function')

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

@@ -6,0 +6,0 @@ "Douglas Christopher Wilson <doug@somethingdoug.com>",