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
Inconsistent behaviour of req.query #2661
Comments
Remember, you can always provide a function to app.set('query parser', function (str) {
return qs.parse(str, {arrayLimit: 1000});
}); Otherwise, any documentation requests should be submitted to https://github.com/strongloop/expressjs.com :) |
Thank you for a quick response! I've described this issue on stackoverflow so that it's googlable. This should be enough to help others that will run into this issue to get it fixed quickly. |
Hi,
The depth still stayed at 5. And anything deeper gets setup as long string. |
@bartonsprings what exact version of Express are you using? |
|
Also, @bartonsprings , that statement must be before the very first |
Aah! Let me try that and report back the result. |
Great! works now. Thanks. |
Calling
/?x[20]=20
returnsreq.query = { x: [ '20' ] }
Calling
/?x[21]=21
returnsreq.query = { x: { '21': '21' } }
I just spent significant amount of time debugging that and it turns out that qs library is responsible:
This value (
20
) can be changed so that's not a problem. However, I believe this should be documented in express.The text was updated successfully, but these errors were encountered: