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.9.3 to 1.10.0

5

HISTORY.md

@@ -0,1 +1,6 @@

1.10.0 / 2014-12-02
===================
* make internal `extended: true` array limit dynamic
1.9.3 / 2014-11-21

@@ -2,0 +7,0 @@ ==================

32

lib/types/urlencoded.js

@@ -113,9 +113,6 @@ /*!

var opts = {
arrayLimit: 100,
parameterLimit: parameterLimit
}
return function queryparse(body) {
var paramCount = parameterCount(body, parameterLimit)
return function queryparse(body) {
if (overlimit(body, parameterLimit)) {
if (paramCount === undefined) {
var err = new Error('too many parameters')

@@ -126,3 +123,8 @@ err.status = 413

return parse(body, opts)
var arrayLimit = Math.max(100, paramCount)
return parse(body, {
arrayLimit: arrayLimit,
parameterLimit: parameterLimit
})
}

@@ -132,3 +134,3 @@ }

/**
* Determine if the parameter count is over the limit.
* Count the number of parameters, stopping once limit reached
*

@@ -140,7 +142,3 @@ * @param {string} body

function overlimit(body, limit) {
if (limit === Infinity) {
return false
}
function parameterCount(body, limit) {
var count = 0

@@ -154,7 +152,7 @@ var index = 0

if (count === limit) {
return true
return undefined
}
}
return false
return count
}

@@ -204,3 +202,5 @@

return function queryparse(body) {
if (overlimit(body, parameterLimit)) {
var paramCount = parameterCount(body, parameterLimit)
if (paramCount === undefined) {
var err = new Error('too many parameters')

@@ -207,0 +207,0 @@ err.status = 413

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

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

"istanbul": "0.3.2",
"methods": "~1.1.0",
"mocha": "~2.0.0",

@@ -25,0 +26,0 @@ "supertest": "~0.15.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