Clarify modification of req.params #165

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@seth-admittedly

This clarifies the usage of req.params, including an anti-pattern example that will cause unexpected behavior.

seth-admittedly added some commits Jun 19, 2014
@seth-admittedly seth-admittedly Clarify modification of req.params
This clarifies the usage of req.params, including an anti-pattern example that will cause unexpected behavior.
8173acb
@seth-admittedly seth-admittedly Typo correction aad1747
@ritch ritch commented on the diff Aug 1, 2014
4x/en/api/app-param.jade
@@ -29,6 +29,27 @@ section
});
p.
+ The <code>req.params</code> object is generally not safely writable. Only keys which are original to the object can be modified.
@ritch
ritch Aug 1, 2014 Member

This applies more to req.params than app.param(), not sure this belongs in this section.

IMO it is sufficient to mention in the req.params section that the object is read only.

@hacksparrow
Member

Does not belong to app.param. Also, there are many other objects, a developer might try to set properties on. Cannot add them all, unless a decision is made about such possibilities.

@hacksparrow hacksparrow closed this Sep 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment