mirror of
https://github.com/symfony/recipes.git
synced 2026-09-11 23:26:27 +03:00
Merge pull request #182
This commit is contained in:
@@ -3,7 +3,6 @@ framework:
|
||||
#default_locale: en
|
||||
#csrf_protection: ~
|
||||
#http_method_override: true
|
||||
#trusted_hosts: ~
|
||||
|
||||
# uncomment this entire section to enable sessions
|
||||
#session:
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
},
|
||||
"env": {
|
||||
"APP_ENV": "dev",
|
||||
"APP_SECRET": "%generate(secret)%"
|
||||
"APP_SECRET": "%generate(secret)%",
|
||||
"#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2",
|
||||
"#TRUSTED_HOSTS": "localhost,example.com"
|
||||
},
|
||||
"gitignore": [
|
||||
".env",
|
||||
|
||||
@@ -21,7 +21,13 @@ if ($_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev'))) {
|
||||
Debug::enable();
|
||||
}
|
||||
|
||||
// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);
|
||||
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
|
||||
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
||||
}
|
||||
|
||||
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {
|
||||
Request::setTrustedHosts(explode(',', $trustedHosts));
|
||||
}
|
||||
|
||||
$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev')));
|
||||
$request = Request::createFromGlobals();
|
||||
|
||||
Reference in New Issue
Block a user