Skip to content

Commit 5f8e5a8

Browse files
committed
cloud env
1 parent fcbd9b1 commit 5f8e5a8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Illuminate/Http/Middleware/TrustProxies.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ protected function setTrustedProxyIpAddresses(Request $request)
6868
{
6969
$trustedIps = $this->proxies() ?: config('trustedproxy.proxies');
7070

71+
if (is_null($trustedIps) &&
72+
(($_ENV['LARAVEL_CLOUD'] ?? false) === '1' ||
73+
($_SERVER['LARAVEL_CLOUD'] ?? false) === '1')) {
74+
$trustedIps = '*';
75+
}
76+
7177
if ($trustedIps === '*' || $trustedIps === '**') {
7278
return $this->setTrustedProxyIpAddressesToTheCallingIp($request);
7379
}

0 commit comments

Comments
 (0)