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

Makes an arrayLimit configurable #43

Closed
seeden opened this issue Sep 4, 2014 · 4 comments
Closed

Makes an arrayLimit configurable #43

seeden opened this issue Sep 4, 2014 · 4 comments

Comments

@seeden
Copy link

seeden commented Sep 4, 2014

Please, can you add arrayLimit (qs library) as optional parameter like a parameterLimit?
For this I created request month ago. ljharb/qs#18

@dougwilson
Copy link
Contributor

Hi! I'm not sure how I was supposed to know that your issue over in qs meant you wanted an option over here :)

In any case, the default for this library is an arrayLimit of 100. I do not plan to add the ability to configure anything qs-specific through this library as this time. It's the reason the option is extended: true and not parser: 'qs'--to keep the parsing library abstracted.

If you really want me to, please describe to me a really good reason you need an arrayLimit different from 100 and also why you cannot send JSON instead of a urlencoded body.

@seeden
Copy link
Author

seeden commented Sep 4, 2014

Maybe you do not understand me. You guys are doing a great job. I am using body-parser with expressjs for parsing of post requests with extended = true. Few versions before was this limit hard coded to 20 in a QS library. Because your library is in the middle of expressjs and qs I would like to have a option to set this optional parameter. Is it possible?

@dougwilson
Copy link
Contributor

Well, it is not possible at this time, no, but I'm just trying to understand why you would need to make it configurable. The main reason I don't really want to is because this library is trying to hide the fact that extended: true is even using qs. As far as the user is concerned, it could be using foobuzz to parse the query string.

I added parameterLimit because the option works for both extended: true and extended: false. arrayLimit is really an implementation detail of just the qs module and it doesn't even apply to the querystring module.

I did bump up the default from 20 to 100 recently. Do you still need a larger limit? If so, you really need to be using JSON bodies and not urlencoded bodies. The extended urlencoded bodies are there purely for HTML <form> entries. You surely do not have a HTML <form> with over 100 <input> elements, do you?

@seeden
Copy link
Author

seeden commented Sep 4, 2014

Thanks for explanation. I will use bodyParser.json() with (application/json) instead of bodyParser.urlencoded.

dougwilson added a commit that referenced this issue Oct 30, 2014
closes #42
closes #43
closes #46
closes #58
closes #60
closes #61
closes #65
dougwilson added a commit that referenced this issue Nov 22, 2014
closes #42
closes #43
closes #46
closes #58
closes #60
closes #61
closes #65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants