[Router] Fix DumpedUrlMatcher behaviour with trailing slash#33362
[Router] Fix DumpedUrlMatcher behaviour with trailing slash#33362xavierleune wants to merge 1 commit intosymfony:3.4from
Conversation
60997a8 to
8a2b788
Compare
|
I just posted #32996 (comment), which I wrote offline before seeing this PR. |
| $this->assertSame(['_route' => 'foo'], $matcher->match('/foo')); | ||
| } | ||
|
|
||
| public function testFallbackPage() |
|
(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.