Skip to content

Commit 4bf313f

Browse files
authored
feat: Enhance Proxy Registration and Prevent Memory Leak (#293)
1 parent eeb16e2 commit 4bf313f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Http/Middleware/TrustProxies.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ protected function setTrustedProxyCloudflare(Request $request): void
5858
$cachedProxies = Cache::rememberForever($cacheKey, fn () => LaravelCloudflare::getProxies());
5959

6060
if (count($cachedProxies) > 0) {
61-
$this->proxies = array_merge((array) $this->proxies, $cachedProxies);
61+
parent::at(collect((array) parent::$alwaysTrustProxies)
62+
->merge($cachedProxies)
63+
->unique()
64+
->toArray()
65+
);
6266
}
6367
}
6468
}

0 commit comments

Comments
 (0)