Skip to content

[Routing] fix trailing slash redirection #29373

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

Merged
merged 1 commit into from
Nov 29, 2018

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 4.1
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #29363
License MIT
Doc PR -

@nicolas-grekas nicolas-grekas added this to the 4.1 milestone Nov 29, 2018
@nicolas-grekas nicolas-grekas merged commit fbaba23 into symfony:4.1 Nov 29, 2018
nicolas-grekas added a commit that referenced this pull request Nov 29, 2018
This PR was merged into the 4.1 branch.

Discussion
----------

[Routing] fix trailing slash redirection

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29363
| License       | MIT
| Doc PR        | -

Commits
-------

fbaba23 [Routing] fix trailing slash redirection
@nicolas-grekas nicolas-grekas deleted the route-fix branch November 29, 2018 15:13
@jimmycleuren
Copy link

Hm, this does not seem to fix the issue for me.

Btw, what is the easiest/best way to check this ? I manually copy/pasted your changes in my vendor folder now.

@nicolas-grekas
Copy link
Member Author

Now that it's merged, you can require ~4.1@dev I think. Copy/pasting in vendor works also.
About your issue, without a reproducer, I'm can't to anything I'm afraid.
I think you have a route earlier in the list that takes precedence. Is it legit or not? I can't tell without having it :)

@rodrigonull
Copy link

I don't know if is the same issue, but I have a problem with the route /{id}/

The route matches but the id parameter value is appended with the '/'.

For example /1/ . The id value should be "1" but i get "1/"

This problem began with version 4.1.8 and with this patch the problem remains.

@nicolas-grekas
Copy link
Member Author

any reproducer?

@jimmycleuren
Copy link

I've created a demo app to reproduce the issue. If you try to access /user/ or /admin/, you'll get the error while those routes are ok according to debug:router.

https://github.com/jimmycleuren/routing-issue

@nicolas-grekas
Copy link
Member Author

nicolas-grekas commented Nov 30, 2018

@jimmycleuren thanks understood, I'm on it (#29380 fixes it but is still not finished)

This was referenced Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants