-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Router] Fix DumpedUrlMatcher behaviour with trailing slash #33362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
60997a8
to
8a2b788
Compare
I just posted #32996 (comment), which I wrote offline before seeing this PR. |
@@ -115,17 +115,6 @@ public function testSchemeRequirement() | |||
$this->assertSame(['_route' => 'foo'], $matcher->match('/foo')); | |||
} | |||
|
|||
public function testFallbackPage() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This guarded against the regression found in #29297
(Trick to update fixtures: add a |
Thank you for #32996 (comment) it helps understand your use case a lot. I think there is no bug on 3.4 so that this PR shouldn't be merged. Can you confirm routes like this allow working around the behavior that annoys you?
Would your use case be fixed by reconfiguring the router to use As a follow up, I'd suggest opening a new feature request. Global or local flag/option could be discussed there (we could have a per-route option, and be able to enable it by default like the |
Thanks, following this comment on #32996 I double checked things here and I think there is no bug either in 3.4 or in any 4.X version. Sorry you've lost some time here. So instead of trying to fix things according to documentation, I've opened a PR on symfony-docs#12247. So I'll reopen and rework #33342 to discuss about the global flag. |
The trailing slash management seems not to be quite consistant across matchers. This pull request fixes the behaviour with the current state of mind: when you have an exact route, you should always use it, not trying to redirect request.
Things are a little bit tricky here, specially when it comes to the DumpedUrlMatcher, but it was adding a lot of complexity than trying to keep things in a single function.