We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If you specify a query-parameter multiple times, you can bypass the validation. Not tested for other locations
Use simple validation as shown below app.get('/',[query("test").isAlphanumeric()], (req,res,next) => { validationResult(req).throw() //something })
app.get('/',[query("test").isAlphanumeric()], (req,res,next) => { validationResult(req).throw() //something })
http://localhost:8000/?test=A&test=!! --> passes
Validation should fail, since express handles stuff like this as array. Should check every value of given array. --> { test: [ 'A', '!!' ] }
{ test: [ 'A', '!!' ] }
Validation passes
The text was updated successfully, but these errors were encountered:
It is a known issue, it will be fixed in v7 (#1002). For the moment if you expect test to be an array you should use wildcards like
test
query('test.*').isAlphanumeric()
Sorry, something went wrong.
No branches or pull requests
Describe the bug
If you specify a query-parameter multiple times, you can bypass the validation. Not tested for other locations
To Reproduce
Use simple validation as shown below
app.get('/',[query("test").isAlphanumeric()], (req,res,next) => { validationResult(req).throw() //something })
http://localhost:8000/?test=A&test=!! --> passes
Expected behavior
Validation should fail, since express handles stuff like this as array.
Should check every value of given array.
-->
{ test: [ 'A', '!!' ] }
Current behavior
Validation passes
Express-validator version:
The text was updated successfully, but these errors were encountered: