URL Encoded Body Parser Behaviour

48 views
Skip to first unread message

Mario Pareja

unread,
Jun 23, 2014, 11:54:02 AM6/23/14
to res...@googlegroups.com
Hi All,

I find it strange that the URL encoded body parser will replace req.body with the parsed data only when "mapParams" is false. What is the reasoning behind this? I would expect mapParams to simply control whether or not the parsed values should result in a mutation of req.params.

I believe the form body parser should always try to update req.body not conditionally due to mapParams: https://github.com/mcavage/node-restify/blob/master/lib/plugins/form_body_parser.js#L55This would be consistent with the behaviour exhibited by the JSON body parser: https://github.com/mcavage/node-restify/blob/master/lib/plugins/json_body_parser.js#L60.

Thoughts?

Regards,


Mario Pareja



Reply all
Reply to author
Forward
0 new messages