From ee83f6c100299f7d5c73d350695cc5bc048fbf79 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Mon, 1 Sep 2014 22:40:04 -0400 Subject: [PATCH] change urlencoded extended array limit to 100 closes #42 --- HISTORY.md | 1 + lib/types/urlencoded.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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) } }