Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about arrayLimit #265

Closed
stream7 opened this issue Jun 16, 2018 · 2 comments
Closed

Question about arrayLimit #265

stream7 opened this issue Jun 16, 2018 · 2 comments
Labels

Comments

@stream7
Copy link

stream7 commented Jun 16, 2018

From the readme:

qs will also limit specifying indices in an array to a maximum index of 20. Any array members with an index of greater than 20 will instead be converted to an object with the index as the key:

Hi there! I was just wondering what's the reasoning behind this decision. Why have a limit there by default with such a surprising behaviour? (returns an object instead of an array)

@ljharb
Copy link
Owner

ljharb commented Jun 16, 2018

The decision long predates me; all I can find is #18 (comment).

I'm assuming the limits, and the behavior, prevent DOS attacks by crafting malicious input.

@stream7
Copy link
Author

stream7 commented Jun 16, 2018

@ljharb I can't say I really understand the reasoning (and I read all of the history/issues), I would assume this kind of security protection belongs to a different abstraction but thanks a lot for checking and for pointing me to that discussion (I should have searched better :) ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants