Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Environment var + routing schemes is broken with 3.3.7+ #24086

Closed
@lyrixx

Description

@lyrixx
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.7

Hello.

Issue

We used to control the scheme of the URL with an environment variable (HTTP_SCHEME).
It used to work fine until Symfony 3.3.7

Reproducer

We noticed a regression in the processing of environment variables and routing schemes.

I have created a producer here.
It's an extra commit on top of the standard edition with Symfony 3.3.*

I order to reproduce the issue you need a real web server (does not work
with PHP -S, nor bin/console server:run).

In the web server you have to add the following line in the PHP location:

fastcgi_param HTTP_SCHEME https;

edit: read the next comment

Results

(I removed useless headers )

With Symfony 3.3.6:

>[{..}/dev/debug/sf-routing-schema-param](master *) curl http://sf-routing-schema-param.localhost:8888/app_dev.php -I
HTTP/1.1 301 Moved Permanently
Location: https://sf-routing-schema-param.localhost/app_dev.php/

With Symfony 3.3.7, 3.3.8, and 3.3.*@dev:

>[{..}/dev/debug/sf-routing-schema-param](master *) curl http://sf-routing-schema-param.localhost:8888/app_dev.php -I
HTTP/1.1 200 OK
Server: nginx/1.12.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions