From f6585a3b41c32eef349c4aa51be705fcf98b97e6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 17 Nov 2018 07:21:00 +0100 Subject: [PATCH] TRUSTED_HOSTS is a regexp --- symfony/framework-bundle/3.3/manifest.json | 2 +- symfony/framework-bundle/3.3/public/index.php | 2 +- symfony/framework-bundle/4.2/manifest.json | 2 +- symfony/framework-bundle/4.2/public/index.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/symfony/framework-bundle/3.3/manifest.json b/symfony/framework-bundle/3.3/manifest.json index bffbcfe7..ad7fd41a 100644 --- a/symfony/framework-bundle/3.3/manifest.json +++ b/symfony/framework-bundle/3.3/manifest.json @@ -15,7 +15,7 @@ "APP_ENV": "dev", "APP_SECRET": "%generate(secret)%", "#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2", - "#TRUSTED_HOSTS": "localhost,example.com" + "#TRUSTED_HOSTS": "'^localhost|example\\.com$'" }, "gitignore": [ "/.env.local", diff --git a/symfony/framework-bundle/3.3/public/index.php b/symfony/framework-bundle/3.3/public/index.php index 3f40a88b..9b4b36b4 100644 --- a/symfony/framework-bundle/3.3/public/index.php +++ b/symfony/framework-bundle/3.3/public/index.php @@ -17,7 +17,7 @@ if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? } if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) { - Request::setTrustedHosts(explode(',', $trustedHosts)); + Request::setTrustedHosts([$trustedHosts]); } $kernel = new Kernel($_SERVER['APP_ENV'], $_SERVER['APP_DEBUG']); diff --git a/symfony/framework-bundle/4.2/manifest.json b/symfony/framework-bundle/4.2/manifest.json index bffbcfe7..ad7fd41a 100644 --- a/symfony/framework-bundle/4.2/manifest.json +++ b/symfony/framework-bundle/4.2/manifest.json @@ -15,7 +15,7 @@ "APP_ENV": "dev", "APP_SECRET": "%generate(secret)%", "#TRUSTED_PROXIES": "127.0.0.1,127.0.0.2", - "#TRUSTED_HOSTS": "localhost,example.com" + "#TRUSTED_HOSTS": "'^localhost|example\\.com$'" }, "gitignore": [ "/.env.local", diff --git a/symfony/framework-bundle/4.2/public/index.php b/symfony/framework-bundle/4.2/public/index.php index 3f40a88b..9b4b36b4 100644 --- a/symfony/framework-bundle/4.2/public/index.php +++ b/symfony/framework-bundle/4.2/public/index.php @@ -17,7 +17,7 @@ if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? } if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) { - Request::setTrustedHosts(explode(',', $trustedHosts)); + Request::setTrustedHosts([$trustedHosts]); } $kernel = new Kernel($_SERVER['APP_ENV'], $_SERVER['APP_DEBUG']);