Mutable router params #131

Closed
davglass opened this Issue Oct 15, 2010 · 5 comments

Projects

None yet

3 participants

@davglass

req.params gets over written on each route so a middleware app can't modify them as they are passed to the next route.

Here is a patch file that fixes this issue:

http://gist.github.com/628761

@tj
Member
tj commented Oct 15, 2010

there could be more/less params for the following route though

@davglass

True, but at the moment, that wouldn't happen either, since each route processed over writes all the other params..

We would add a mix there to mix the two together..

The end issue being that middleware can't change it ;)

@tj
Member
tj commented Oct 15, 2010

hmm wonder if we should handle this in express, since this is with the route-specific middleware right?

@davglass

I thought about doing that, but the route statically connects those params on each iteration. It just seems like the right place to put it, since middleware is middleware.

@tj
Member
tj commented Oct 15, 2010

hmm not sure how i feel about it, nothing stands out to me as far as it being some sort of gotcha, but seems like it could potentially be an issue in some cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment