From b2bc90d7fd7b6233f28006817187b18953866642 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 20 Nov 2024 09:54:37 -0600 Subject: [PATCH] cloud env --- src/Illuminate/Http/Middleware/TrustProxies.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Illuminate/Http/Middleware/TrustProxies.php b/src/Illuminate/Http/Middleware/TrustProxies.php index 81906c1f1951..cd5c63ecbd0e 100644 --- a/src/Illuminate/Http/Middleware/TrustProxies.php +++ b/src/Illuminate/Http/Middleware/TrustProxies.php @@ -49,6 +49,12 @@ protected function setTrustedProxyIpAddresses(Request $request) { $trustedIps = $this->proxies() ?: config('trustedproxy.proxies'); + if (is_null($trustedIps) && + (($_ENV['LARAVEL_CLOUD'] ?? false) === '1' || + ($_SERVER['LARAVEL_CLOUD'] ?? false) === '1')) { + $trustedIps = '*'; + } + if ($trustedIps === '*' || $trustedIps === '**') { return $this->setTrustedProxyIpAddressesToTheCallingIp($request); }