-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] Route with trailing slash redirects to route without slash #29438
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
Comments
@emodric |
Hm, wasn't aware of that. However, as I said, this works fine on 4.1.7 and latest 3.4, and it broke in 4.1.8. Shouldn't that be a BC break? |
Thanks for the pointers to the previous discussions @dkarlovi. @nicolas-grekas Should I close this then? |
I think yes - at least I don't see how we can "fix" this while preserving the behavior that the linked PRs have also fixed. |
Okay, no problem. I will have to find an other way to get what I want. Just for the reference, I used the above routes because of eZ Platform. eZ Platform has a concept of siteaccesses, basically, a set of configuration which is loaded dynamically, based on current request. One of the ways to match which configuration will be loaded is by using an URI part which is injected by eZ before the Symfony path info, thus, it is not part of the Symfony route. So when Symfony redirects the routes from one to the other, that URI part is lost, effectivelly redirecting to the wrong part of the site. For example: two routes exist: |
Swapping the order of declaration maybe?
|
It works, yes, i tried it already, but then it doesn't work on Symfony 3.4 and 4.1.7 😂 Anyway, I might just remove the redirects altogether, might be easier and less annoying. |
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 4.2.0 and 4.1.8
Description
I have two routes, one without slash, one with the slash, and with 4.2.0 and 4.1.8, there is a redirect from the route with the slash to the route without the slash, causing infinite redirect loop between the two (obviously because the no-slash route redirects back to slash route). #29380 also does not fix the issue.
This works fine on Symfony 4.1.7 and latest 3.4, i.e. no redirect happens from slash route to no-slash route.
How to reproduce
The following routes cause the problem:
Reproducer is available at https://github.com/emodric/sf_route_redirect_bug
Start the server and open
/foo
to get the infinite redirects.The text was updated successfully, but these errors were encountered: