Browse Source

Add trusted_proxies parameter

Jordi Boggiano 12 years ago
parent
commit
d2c841aaaa
3 changed files with 4 additions and 4 deletions
  1. 1 1
      app/config/config.yml
  2. 3 0
      app/config/parameters.yml.dist
  3. 0 3
      web/app.php

+ 1 - 1
app/config/config.yml

@@ -16,7 +16,7 @@ framework:
     session:
         name:           packagist
         lifetime:       3600
-
+    trusted_proxies: %trusted_proxies%
 
 # Twig Configuration
 twig:

+ 3 - 0
app/config/parameters.yml.dist

@@ -30,3 +30,6 @@ parameters:
     github.client_secret:
 
     force_ssl: false
+
+    # e.g. [127.0.0.1] if the app is running behind a reverse proxy on localhost
+    trusted_proxies: ~

+ 0 - 3
web/app.php

@@ -12,9 +12,6 @@ require_once __DIR__.'/../app/AppCache.php';
 $kernel = new AppKernel('prod', false);
 $kernel->loadClassCache();
 $kernel = new AppCache($kernel);
-if ($_SERVER['HTTP_HOST'] === 'packagist.org') {
-    Request::trustProxyData();
-}
 $request = Request::createFromGlobals();
 $response = $kernel->handle($request);
 $response->send();