Skip to content

Commit

Permalink
Merge pull request #3660 from CachetHQ/trusted-proxy-env-fix
Browse files Browse the repository at this point in the history
Fix use of env
  • Loading branch information
jbrooksuk committed Jun 24, 2019
2 parents 5bb38fd + a3bbeb5 commit 342be3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;

/**
* This is the trust proxies middleware class.
Expand Down Expand Up @@ -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));
}
}
2 changes: 1 addition & 1 deletion config/trustedproxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* 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
Expand Down

0 comments on commit 342be3d

Please sign in to comment.