You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ActionDispatch::Routing::RouteSet#recognize_path does not reset parameters between trying different constraints out. It only adds parameters. Normal matching doesn't exhibit the same behavior and there's a test to make sure of it
Steps to reproduce
Add the following code to actionpack/test/controller/routing_test.rb
In 9b654d4 some params munging was added to ensure that they were
set whenever `recognize_path` would call either a proc or callable
constraint. Since we no longer mutate the environment hash within
the method it's now unnecessary and actually causes params to leak
between route matches before checking constraints.
Fixes#28398.
(cherry picked from commit 886085d)
ActionDispatch::Routing::RouteSet#recognize_path
does not reset parameters between trying different constraints out. It only adds parameters. Normal matching doesn't exhibit the same behavior and there's a test to make sure of itSteps to reproduce
Add the following code to
actionpack/test/controller/routing_test.rb
As you can see the
:foo
parameter was leaked from the first route with non-matching constraint.Expected behavior
No failure
Actual behavior
System configuration
Rails version: 5.0.2, master
Ruby version: 2.3.3
The text was updated successfully, but these errors were encountered: