Repository navigation
docs: fix depth error description - #776
Merged
UlisesGascon merged 1 commit intoOct 21, 2026
Merged
Conversation
The README said that the error is not thrown when depth is 32, the default. The parser always uses strictDepth, so with the default value an input with 33 or more levels of nesting gets a 400 error.
Contributor
|
I have no idea what this was supposed to mean. Maybe @UlisesGascon changed his mind while writing the code, but forgot to update the docs. afd0f39 The test that checks if the error is thrown when the default body-parser/test/urlencoded.js Lines 353 to 365 in 02101da |
UlisesGascon
approved these changes
Oct 21, 2026
Open
UlisesGascon
pushed a commit
that referenced
this pull request
Oct 21, 2026
(cherry picked from commit 73713f7)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! 🙂 The README says that the "input exceeded the depth" error is not thrown when
depthis32, the default. It is thrown.urlencodedalways passesstrictDepth: truetoqs, so with the default configuration an input with 33 levels of nesting gets a 400.Output on 2.3.0 and on 1.20.8 (Node 24.21.0):
The existing tests in
test/urlencoded.js('when default value') already expect this: 32 levels pass, 33 return 400. This change replaces the last sentence of that section with the real behavior.The
1.xbranch has the same sentence. Happy to open a PR there too, or to change the wording 🙌