Cleanest solution would be to write a middleware that replaces req.* with your own sanitized versions.
 
You also can replace req.* with getters/setters that check if they were asserted. There're a lot of good ways to do that.
 
--
// alex
 
 
02.12.2013, 13:42, "Richard Marr" <[email protected]>:
Hi all,

I couldn't find anything like this so knocked a sample up... it's a quick automated test that reads all of the route handlers in an Express app and fails the test if it finds any parameters from req.query, req.body, req.param being used that haven't also been through express-validator's req.assert() method.
The code is pretty ugly but it's working well enough in my app.

https://gist.github.com/richmarr/7747115

Has anyone found a less fugly way to do this?




--
Richard Marr

 

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to