symfony/symfony — pull request #11889 by zerrvox (2014-09-09 11:24:34+00:00)
Title: [Routing] Make RedirectableUrlMatcher preserve schema when no slash

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

When redirecting a route i.e. /foo/ called as /foo preserve schema. Current behaviour is to always use http if both http and https is allowed for the route.

This can lead to unexpected behaviour if https is enforced by different means than through Symfony i.e. by Apache mod_rewrite.

We had a hard to debug situation where a page included by in an iframe was blocked by Google Chrome because of the non-secure redirect. As the redirect is not shown in developer tools in Chrome, this took some time to track down.