mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-01 21:00:58 +00:00
feat(app): fresh module-platform, provider, middleware, rule and support implementation
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustProxies as FrameworkTrustProxies;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Teaches the request object which upstream proxies may rewrite the client's
|
||||
* address, host, port and scheme.
|
||||
*/
|
||||
class TrustProxies extends FrameworkTrustProxies
|
||||
{
|
||||
/**
|
||||
* Proxies the application accepts forwarded headers from, resolved lazily
|
||||
* by {@see self::proxies()}.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* Bitmask of the forwarding headers that are honoured.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* Resolve the trusted proxy list.
|
||||
*
|
||||
* Defaults to trusting every hop, which suits the containerised installs
|
||||
* that sit behind an operator-controlled reverse proxy.
|
||||
*
|
||||
* @return string|array|null
|
||||
*/
|
||||
protected function proxies()
|
||||
{
|
||||
$this->proxies = env('TRUSTED_PROXIES', '*');
|
||||
|
||||
return $this->proxies;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user