From 4ceed92eec4d77713f4745df8c26e098ae21cf0f Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Sun, 1 Jan 2023 22:09:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=20=E4=BF=A1=E4=BB=BB?= =?UTF-8?q?=E6=89=80=E6=9C=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Middleware/TrustProxies.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 3391630..e6e6454 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -3,7 +3,7 @@ namespace App\Http\Middleware; use Illuminate\Http\Middleware\TrustProxies as Middleware; -use Illuminate\Http\Request; +use Symfony\Component\HttpFoundation\Request as RequestAlias; class TrustProxies extends Middleware { @@ -12,7 +12,9 @@ class TrustProxies extends Middleware * * @var array|string|null */ - protected $proxies; + protected $proxies = [ + '*' + ]; /** * The headers that should be used to detect proxies. @@ -20,9 +22,9 @@ class TrustProxies extends Middleware * @var int */ protected $headers = - Request::HEADER_X_FORWARDED_FOR | - Request::HEADER_X_FORWARDED_HOST | - Request::HEADER_X_FORWARDED_PORT | - Request::HEADER_X_FORWARDED_PROTO | - Request::HEADER_X_FORWARDED_AWS_ELB; + RequestAlias::HEADER_X_FORWARDED_FOR | + RequestAlias::HEADER_X_FORWARDED_HOST | + RequestAlias::HEADER_X_FORWARDED_PORT | + RequestAlias::HEADER_X_FORWARDED_PROTO | + RequestAlias::HEADER_X_FORWARDED_AWS_ELB; }