Skip to content

Commit

Permalink
cloud env
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 20, 2024
1 parent c0dc258 commit b2bc90d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Illuminate/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b2bc90d

Please sign in to comment.