Permalink
Browse files

Calling `request.params` in routing constraints cannot interfere with…

… subsequent routes. [Closes #2510]

As the same request is reused thru all the routing constraints,
accessing a memoized form of `params` would prevent the router from
redefining it with a new set of parameters (the current route
parameters).
  • Loading branch information...
1 parent 6eab906 commit 88862a0d7f0d59759bfc32de6b6688cc1c7b9fa5 @franckverrot committed Aug 15, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/http/parameters.rb
@@ -6,7 +6,7 @@ module Http
module Parameters
# Returns both GET and POST \parameters in a single hash.
def parameters
- @env["action_dispatch.request.parameters"] ||= begin
+ @env["action_dispatch.request.parameters"] = begin
params = request_parameters.merge(query_parameters)
params.merge!(path_parameters)
encode_params(params).with_indifferent_access

0 comments on commit 88862a0

Please sign in to comment.