Fix use of env. Closes #3651

This commit is contained in:
James Brooks 2019-06-23 08:29:24 +01:00
parent 76e9f41e55
commit a3bbeb541e
2 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@ namespace CachetHQ\Cachet\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
/**
* This is the trust proxies middleware class.
@ -42,6 +43,8 @@ class TrustProxies extends Middleware
*/
public function __construct()
{
$this->proxies = empty(env('TRUSTED_PROXIES')) ? '*' : explode(',', trim(env('TRUSTED_PROXIES')));
$proxies = Config::get('trustedproxies.proxies');
$this->proxies = empty($proxies) ? '*' : explode(',', trim($proxies));
}
}

View File

@ -24,7 +24,7 @@ return [
* of your proxy (e.g. if using ELB or similar).
*
*/
'proxies' => null, // [<ip addresses>,], '*'
'proxies' => env('TRUSTED_PROXIES'), // [<ip addresses>,], '*'
/*
* To trust one or more specific proxies that connect