Skip to content

Commit

Permalink
Remove redundant depth check (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey authored Sep 10, 2024
1 parent 1752951 commit f20f6ad
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/types/urlencoded.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ function urlencoded (options) {
: opts.limit
var type = opts.type || 'application/x-www-form-urlencoded'
var verify = opts.verify || false
var depth = typeof opts.depth !== 'number'
? Number(opts.depth || 32)
: opts.depth

if (verify !== false && typeof verify !== 'function') {
throw new TypeError('option verify must be function')
Expand Down Expand Up @@ -121,8 +118,7 @@ function urlencoded (options) {
encoding: charset,
inflate: inflate,
limit: limit,
verify: verify,
depth: depth
verify: verify
})
}
}
Expand All @@ -137,10 +133,7 @@ function extendedparser (options) {
var parameterLimit = options.parameterLimit !== undefined
? options.parameterLimit
: 1000

var depth = typeof options.depth !== 'number'
? Number(options.depth || 32)
: options.depth
var depth = options.depth !== undefined ? options.depth : 32
var parse = parser('qs')

if (isNaN(parameterLimit) || parameterLimit < 1) {
Expand Down

0 comments on commit f20f6ad

Please sign in to comment.