Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Set trusted proxies value from config if present. #882
James Coleebcd8dbd7c6b
diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.phpindex 653ea92659..8fdb80b30d 100644--- a/app/Http/Middleware/TrustProxies.php+++ b/app/Http/Middleware/TrustProxies.php@@ -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);+ }}