Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
60997a8 to8a2b788Comparenicolas-grekas commentedAug 27, 2019
I just posted#32996 (comment), which I wrote offline before seeing this PR. |
| $this->assertSame(['_route' =>'foo'],$matcher->match('/foo')); | ||
| } | ||
| publicfunctiontestFallbackPage() |
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
nicolas-grekas commentedAug 27, 2019
(Trick to update fixtures: add a |
nicolas-grekas commentedAug 29, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 |
xavierleune commentedAug 30, 2019
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 onsymfony-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.