-
-
Notifications
You must be signed in to change notification settings - Fork 616
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
unexpected result of matchedData() when using oneOf() #482
Comments
Hello @pkyeck! Thanks for using express-validator.
Currently, the tests don't say a thing about optional data (at least that's what I got from quickly going thru it), what is a shame!
Given those are within Otherwise, this is quite easy to achieve in user-land. |
I'm already using the For the second part: yep, did this in userland. |
was away from the computer the last couple of days. but thanks for fixing this!! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm trying to validate the token I pass to my REST endpoint. It could be passed in the HTTP headers , a cookie or as a POST parameter. So I'm checking like this:
Now I was expecting the result of
matchedData(req)
to only include the one value that was validated correctly but the other two are in there as well (asundefined
). Is this expected?And it would be great if we could expose the result under the same name. I don't want to get
authorization
,token
orcookiename
but just e.g.token
no matter which of these was set.The text was updated successfully, but these errors were encountered: