-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Symfony 3.3 routing automatic trailing slash missing #23004
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
This is probably because of the huge speed optimizations that have been done on the routing component. Ping @frankdejonge |
@dubaksk does this happen only in the prod env or also on your dev env? |
@frankdejonge It happens on all environments. We do not consider this happen due to different environment set up. |
Ok, so then we know it's not because of the matcher dumper optimisation because those aren't used in dev. We could look into the RouteCompiler next, I'll check that out. |
Hmm, it seems the matcher dumper is actually used, digging into that now. |
@dubaksk what version did you upgrade from? |
@dubaksk from what I see those redirects only happen for HEAD requests, or for routes that haven't defined methods. Which is both a little wonky. In my perception it should be done on non HEAD and GET routes. The code that determines it dates back 6 years, so it popping up now is a bit odd (https://github.com/symfony/symfony/blame/master/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php#L241). Perhaps this was a side-effect from another commit. |
@dubaksk I've created a PR, perhaps you can check it out? See above. |
@frankdejonge Great, so you allowed also GET method. Give me a some time to verify the fix. I will let you know. |
@dubaksk 👍 |
@frankdejonge We verified your pull request and it's working as before on 3.2.9 version 👍
So what's the scenario now? We have to wait until pull request is accepted and then you will release 3.3.X version with this fix? |
@dubaksk another option for now would be to include the HEAD method in addition to the GET method. But for the actual fix we'd need to wait for 3.3.1 like you mentioned. |
@frankdejonge Yep, this will be the way. Thank you guys and mostly you @frankdejonge for such a prompt solution. |
…(frankdejonge) This PR was merged into the 3.3 branch. Discussion ---------- [Routing] Allow GET requests to be redirected. Fixes #23004 | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23004 | License | MIT | Doc PR | NA GET requests didn't get the same redirect treatment as HEAD requests. I've also added tests cases for all the different trailing/non-trailing slash situations. Commits ------- 71d4e36 [Routing] Allow GET requests to be redirected. Fixes #23004
* 3.3: (31 commits) Using FQ name for PHP_VERSION_ID [EventDispatcher] Handle laziness internally instead of relying on ClosureProxyArgument Fix CacheCollectorPass priority [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323 [Routing] Allow GET requests to be redirected. Fixes #23004 [DI] Deal with inlined non-shared services [Cache] Ignore missing annotations.php [DI] Autowiring exception thrown when inlined service is removed Improving deprecation message when hitting the "deprecated type" lookup, but an alias is available Harden the debugging of Twig filters and functions Fixing a bug where an autowiring exception was thrown even when that service was removed Remove extra arg in call to TraceableAdapter::start() Support unknown compiler log format [Config] Allow empty globs Fix decorating TagAware adapters in dev [Profiler] Fix clicking on links inside toggle [Profiler] Fix text selection on exception pages bumped Symfony version to 3.3.1 updated VERSION for 3.3.0 updated CHANGELOG for 3.3.0 ...
* 3.4: (31 commits) Using FQ name for PHP_VERSION_ID [EventDispatcher] Handle laziness internally instead of relying on ClosureProxyArgument Fix CacheCollectorPass priority [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323 [Routing] Allow GET requests to be redirected. Fixes #23004 [DI] Deal with inlined non-shared services [Cache] Ignore missing annotations.php [DI] Autowiring exception thrown when inlined service is removed Improving deprecation message when hitting the "deprecated type" lookup, but an alias is available Harden the debugging of Twig filters and functions Fixing a bug where an autowiring exception was thrown even when that service was removed Remove extra arg in call to TraceableAdapter::start() Support unknown compiler log format [Config] Allow empty globs Fix decorating TagAware adapters in dev [Profiler] Fix clicking on links inside toggle [Profiler] Fix text selection on exception pages bumped Symfony version to 3.3.1 updated VERSION for 3.3.0 updated CHANGELOG for 3.3.0 ...
* 3.3: (31 commits) Using FQ name for PHP_VERSION_ID [EventDispatcher] Handle laziness internally instead of relying on ClosureProxyArgument Fix CacheCollectorPass priority [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323 [Routing] Allow GET requests to be redirected. Fixes symfony#23004 [DI] Deal with inlined non-shared services [Cache] Ignore missing annotations.php [DI] Autowiring exception thrown when inlined service is removed Improving deprecation message when hitting the "deprecated type" lookup, but an alias is available Harden the debugging of Twig filters and functions Fixing a bug where an autowiring exception was thrown even when that service was removed Remove extra arg in call to TraceableAdapter::start() Support unknown compiler log format [Config] Allow empty globs Fix decorating TagAware adapters in dev [Profiler] Fix clicking on links inside toggle [Profiler] Fix text selection on exception pages bumped Symfony version to 3.3.1 updated VERSION for 3.3.0 updated CHANGELOG for 3.3.0 ...
* 3.4: (31 commits) Using FQ name for PHP_VERSION_ID [EventDispatcher] Handle laziness internally instead of relying on ClosureProxyArgument Fix CacheCollectorPass priority [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323 [Routing] Allow GET requests to be redirected. Fixes symfony#23004 [DI] Deal with inlined non-shared services [Cache] Ignore missing annotations.php [DI] Autowiring exception thrown when inlined service is removed Improving deprecation message when hitting the "deprecated type" lookup, but an alias is available Harden the debugging of Twig filters and functions Fixing a bug where an autowiring exception was thrown even when that service was removed Remove extra arg in call to TraceableAdapter::start() Support unknown compiler log format [Config] Allow empty globs Fix decorating TagAware adapters in dev [Profiler] Fix clicking on links inside toggle [Profiler] Fix text selection on exception pages bumped Symfony version to 3.3.1 updated VERSION for 3.3.0 updated CHANGELOG for 3.3.0 ...
After upgrading to Symfony 3.3.0 we realised, that when we had something like this:
when I put into browser URL without trailing slash, I was redirected automatically to URL with trailing slash. And it worked also other way.
In profiler -> request -> parameters, I could see:
It was ok. But since 3.3 version this feature is missing and we could not find it in changelog if it was change intentionally. Now the page without trailing slash is giving us error 404 and we really don't want to go through whole project and update all routes, so this trailing slash would be optional..
The text was updated successfully, but these errors were encountered: