. */ 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 * * @codeCoverageIgnore */ class TrustProxies extends Middleware { /** @var int The headers to check. */ protected $headers = Request::HEADER_X_FORWARDED_ALL; /** * TrustProxies constructor. * * @param Repository $config */ public function __construct(Repository $config) { $trustedProxies = (string)config('firefly.trusted_proxies'); $this->proxies = explode(',', $trustedProxies); if ('**' === $trustedProxies) { $this->proxies = '**'; } parent::__construct($config); } }