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

36 lines
811 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.
*
2023-03-26 23:04:06 +02:00
* @var array<int, string>|string|null
2019-05-20 07:37:41 +02:00
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
2022-11-22 15:15:52 +01:00
protected $headers = Request::HEADER_X_FORWARDED_FOR |
2021-12-02 13:15:53 +01:00
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');
}
2022-11-22 15:15:52 +01:00
}