2FAuth/app/Http/Middleware/TrustProxies.php

36 lines
805 B
PHP
Raw Normal View History

2019-05-20 07:37:41 +02:00
<?php
namespace App\Http\Middleware;
2021-12-02 13:15:53 +01:00
use Illuminate\Http\Middleware\TrustProxies as Middleware;
2019-05-20 07:37:41 +02:00
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
2021-12-02 13:15:53 +01:00
* @var array|string|null
2019-05-20 07:37:41 +02:00
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
2021-12-02 13:15:53 +01:00
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
2022-04-14 11:34:40 +02:00
/**
* TrustProxies constructor.
*/
public function __construct()
{
$this->proxies = (string) config('2fauth.config.trustedProxies');
}
2021-12-02 13:15:53 +01:00
}