-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Better handling of router-level redirections #28806
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
Can you please outline the changes needed for end users who make redirections in YAML/XML routing files and in controllers? Thanks! |
this is not about redirections defined by users using the RedirectController. This is about redirections performed by the router itself (to add or remove trailing slashes) |
For routes defined using the RedirectController, this redirection is performed using a normal match at the router level, so there is no issue, and no lie saying that it was the matched route (it was). |
@stof are you referring to this issue? [Bug] Firewall triggers on RedirectController::urlRedirectAction #23232 |
@iltar yes. thanks for finding it again. |
I think #30501 provided a workable approach and merging it again in 5.2 would essentially allow us to close this issue. |
Thank you for this issue. |
Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3 |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
Description
Currently, router-level redirections require to use a special controller performing the redirection. But this has several drawbacks:
_route
is returned as the route which was not actually matched (but redirected to, to match), which means that the contract for this attribute is not actually that it is the name of the matched route.A better solution would be to specify a dedicated return format for the matcher, which would tell the RouterListener that it must redirect (which it can do by setting a response, which will stop the request handling early).
We might still need to return the existing (lying) properties alongside the redirection marker to preserve BC for places calling the UrlMatcher directly outside the RouterListener.
The text was updated successfully, but these errors were encountered: