Is the parameter req passed to matchedData used ?
See original GitHub issueHi,
Since i updated to 6.1.0 (no problem in 5.3.1), the req.body
fields are immutable after calling their middleware validator. It looks like the parameter req
passed to matchedData at the call is not used.
Example :
HTTP POST Request :
{
"visible": "on"
}
Middleware :
body('visible', ' ') // From here, changes to req.body property "visible" won't be considered by matchedData(req);
.custom(/* some code */),
function (req, res, next) {
req.body.visible = false; // value 'on' sent by the client in the HTTP POST changed to false
console.log(req.body.visible); // will display false
req.body = matchedData(req);
console.log(req.body.visible); // will display 'on' if no error
}
I would like to know if it is the expected behavior ? It is linked with using Symbol ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
matchedData() - express-validator
Gathering data from multiple locations. If data you validated or sanitized is spread across various request locations (e.g. req.body , req.query , req...
Read more >Express Validator Error: expressValidator is not a function
Express Validator has been updated therefore, you can't use it this way This is a new way to use the express validator.
Read more >Discussion of A Clean Approach to Using Express Validator
I recently used express validator in a project ... Read full post ... matchedData = matchedData(req); return next(); } const extractedErrors ...
Read more >Troubleshoot - Azure Web Application Firewall - Microsoft Learn
The first one says it matched because the user used a numeric/IP URL for the request, which increases the anomaly score by three...
Read more >Logging web ACL traffic - AWS Documentation
Logged information includes the time that AWS WAF received a web request from your AWS resource, detailed information about the request, and details...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, it’s clear now. Thank you 😃
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.