From 2172af6d9ef6622588a5bfcbb4091a7f569d0d70 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 3 Mar 2022 15:01:38 +0000 Subject: [PATCH 1/2] Update TrustProxies.php --- src/Illuminate/Http/Middleware/TrustProxies.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Http/Middleware/TrustProxies.php b/src/Illuminate/Http/Middleware/TrustProxies.php index e9e06968b806..f106899d8c27 100644 --- a/src/Illuminate/Http/Middleware/TrustProxies.php +++ b/src/Illuminate/Http/Middleware/TrustProxies.php @@ -47,7 +47,7 @@ public function handle(Request $request, Closure $next) */ protected function setTrustedProxyIpAddresses(Request $request) { - $trustedIps = $this->proxies(); + $trustedIps = $this->proxies ?: config('trustedproxy.proxies'); if ($trustedIps === '*' || $trustedIps === '**') { return $this->setTrustedProxyIpAddressesToTheCallingIp($request); From 5266cf33648423a9161bf79b9f74fb456cdc0420 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 3 Mar 2022 15:06:34 +0000 Subject: [PATCH 2/2] Use getter --- src/Illuminate/Http/Middleware/TrustProxies.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Http/Middleware/TrustProxies.php b/src/Illuminate/Http/Middleware/TrustProxies.php index f106899d8c27..872fd3ca2e71 100644 --- a/src/Illuminate/Http/Middleware/TrustProxies.php +++ b/src/Illuminate/Http/Middleware/TrustProxies.php @@ -47,7 +47,7 @@ public function handle(Request $request, Closure $next) */ protected function setTrustedProxyIpAddresses(Request $request) { - $trustedIps = $this->proxies ?: config('trustedproxy.proxies'); + $trustedIps = $this->proxies() ?: config('trustedproxy.proxies'); if ($trustedIps === '*' || $trustedIps === '**') { return $this->setTrustedProxyIpAddressesToTheCallingIp($request);