1
0
Fork 0
forked from mirror/pixelfed

Don't always explode the TRUST_PROXIES variable

This commit is contained in:
asonix 2020-01-16 12:14:05 -06:00
parent 0adf959a74
commit cb6e8a4eaa

View file

@ -1,5 +1,13 @@
<?php
$proxyString = env('TRUST_PROXIES', '');
if ($proxyString == '*' || $proxyString == '**') {
$proxies = $proxyString;
} else {
$proxies = explode(',', $proxyString);
}
return [
/*
* Set trusted proxy IP addresses.
@ -23,5 +31,5 @@ return [
* how many proxies that client's request has
* subsequently passed through.
*/
'proxies' => explode(',', env('TRUST_PROXIES', '')),
'proxies' => $proxies,
];