diff --git a/Bootstraps/Symfony.php b/Bootstraps/Symfony.php index 24ba8d6..c44d240 100644 --- a/Bootstraps/Symfony.php +++ b/Bootstraps/Symfony.php @@ -80,6 +80,14 @@ public function getApplication() $app->booted = true; }, $app); + if ($trustedProxies = isset($_SERVER['TRUSTED_PROXIES']) ? $_SERVER['TRUSTED_PROXIES'] : false) { + Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST); + } + + if ($trustedHosts = isset($_SERVER['TRUSTED_HOSTS']) ? $_SERVER['TRUSTED_HOSTS'] : false) { + Request::setTrustedHosts(explode(',', $trustedHosts)); + } + return $app; }