fix: req.query returns object instead of array for >20 repeated values#7193
Closed
IshitaSingh0822 wants to merge 4 commits intoexpressjs:masterfrom
Closed
fix: req.query returns object instead of array for >20 repeated values#7193IshitaSingh0822 wants to merge 4 commits intoexpressjs:masterfrom
IshitaSingh0822 wants to merge 4 commits intoexpressjs:masterfrom
Conversation
- Add extra spacing before edge cases describe block - Address maintainer feedback
Contributor
There's already another PR that tries to solve this problem - #7151. I'll close this as a duplicate. Please include only relevant changes in PRs. GitHub shows commits that were a part of #7037 as new changes here. |
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.
Fixes #7147
qs defaults arrayLimit to 20. When a repeated query param has more
than 20 values, qs returns a plain object with numeric string keys
instead of an array, silently breaking Array.isArray(), .forEach(),
.map() etc.
Fix: set arrayLimit: Infinity in parseExtendedQueryString(). The
existing parameterLimit (default 1000) already caps total query
string size, so there is no DoS risk.