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); }