mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-05 21:53:08 -06:00
Set trusted proxies value from config if present. #882
This commit is contained in:
parent
1bfa8f0139
commit
ebcd8dbd7c
@ -14,6 +14,7 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Http\Middleware;
|
||||
|
||||
use Fideloper\Proxy\TrustProxies as Middleware;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
@ -37,4 +38,19 @@ class TrustProxies extends Middleware
|
||||
* @var array
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* TrustProxies constructor.
|
||||
*
|
||||
* @param Repository $config
|
||||
*/
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$trustedProxies = env('TRUSTED_PROXIES', null);
|
||||
if (!is_null($trustedProxies) && strlen($trustedProxies) > 0) {
|
||||
$this->proxies = $trustedProxies;
|
||||
}
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user