Skip to content
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

[7.x] fix matching trailing slashes with the cached router #31869

Closed
wants to merge 3 commits into from

Conversation

@nicolas-grekas
Copy link
Contributor

nicolas-grekas commented Mar 9, 2020

Fixes #31768

This enables the Symfony matcher to return another route when a trailing slash is found while the definition didn't embed one - and vice versa.

IIUC, Laravel doesn't do redirections for trailing slashes but calls the same controller instead. This does it.

@nicolas-grekas

This comment has been minimized.

Copy link
Contributor Author

nicolas-grekas commented Mar 9, 2020

(fixed) I just realized this might be missing a check to enforce the scheme as this code will render the "http" version of a route when it is defined for "https" only.

Note that removing the trailing slash before calling the matcher would work also I suppose.

@driesvints driesvints changed the title [Routing] fix matching trailing slashes with the cached router [7.x] fix matching trailing slashes with the cached router Mar 9, 2020
driesvints added 2 commits Mar 9, 2020
@taylorotwell

This comment has been minimized.

Copy link
Member

taylorotwell commented Mar 9, 2020

Hey @nicolas-grekas ... thanks for looking at this with us! I think we'll take the approach of trimming the request URI before we hand things off to the Symfony Matcher. Just so we don't need to extend anything and leak out any Symfony implementation details there. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.