Skip to content

Commit d30943c

Browse files
author
marc.weistroff
committed
[FrameworkBundle] Switched to parameters for request context host and scheme
1 parent e08e60c commit d30943c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

UPGRADE-2.1.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,6 +1353,11 @@
13531353
decoded twice before. Note that the `urldecode()` calls have been changed for a
13541354
single `rawurldecode()` in order to support `+` for input paths.
13551355
1356+
* Two new parameters have been added to the DIC: `router.request_context.host`
1357+
and `router.request_context.scheme`. You can customize them for your
1358+
functional tests or for generating urls with the right host and scheme
1359+
when your are in the cli context.
1360+
13561361
### FrameworkBundle
13571362
13581363
* session options: lifetime, path, domain, secure, httponly were deprecated.

src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<parameter key="router.options.matcher.cache_class">%kernel.name%%kernel.environment%UrlMatcher</parameter>
2323
<parameter key="router.options.generator.cache_class">%kernel.name%%kernel.environment%UrlGenerator</parameter>
2424
<parameter key="router_listener.class">Symfony\Component\HttpKernel\EventListener\RouterListener</parameter>
25+
<parameter key="router.request_context.host">localhost</parameter>
26+
<parameter key="router.request_context.scheme">http</parameter>
2527
</parameters>
2628

2729
<services>
@@ -74,8 +76,8 @@
7476
<service id="router.request_context" class="%router.request_context.class%" public="false">
7577
<argument></argument>
7678
<argument>GET</argument>
77-
<argument>localhost</argument>
78-
<argument>http</argument>
79+
<argument>%router.request_context.host%</argument>
80+
<argument>%router.request_context.scheme%</argument>
7981
<argument>%request_listener.http_port%</argument>
8082
<argument>%request_listener.https_port%</argument>
8183
</service>

0 commit comments

Comments
 (0)