diff --git a/HISTORY.md b/HISTORY.md index 97b24749..4b6acf79 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,7 @@ unreleased ========== * add `parameterLimit` option to `urlencoded` parser + * change `urlencoded` extended array limit to 100 * respond with 415 when over `parameterLimit` in `urlencoded` 1.6.7 / 2014-08-29 diff --git a/lib/types/urlencoded.js b/lib/types/urlencoded.js index 6f799c5e..d846e65b 100644 --- a/lib/types/urlencoded.js +++ b/lib/types/urlencoded.js @@ -109,6 +109,11 @@ function extendedparser(options) { parameterLimit = parameterLimit | 0 } + var opts = { + arrayLimit: 100, + parameterLimit: parameterLimit + } + return function queryparse(body) { if (overlimit(body, parameterLimit)) { var err = new Error('too many parameters') @@ -116,7 +121,7 @@ function extendedparser(options) { throw err } - return parse(body, {parameterLimit: parameterLimit}) + return parse(body, opts) } }