Skip to content

Commit

Permalink
change urlencoded extended array limit to 100
Browse files Browse the repository at this point in the history
closes #42
  • Loading branch information
dougwilson committed Sep 2, 2014
1 parent 851cbfd commit ee83f6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion lib/types/urlencoded.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,19 @@ 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')
err.status = 413
throw err
}

return parse(body, {parameterLimit: parameterLimit})
return parse(body, opts)
}
}

Expand Down

0 comments on commit ee83f6c

Please sign in to comment.