CheckForTrustedHost

 class Winter\Storm\Foundation\Http\Middleware\CheckForTrustedHost
extends Winter\Storm\Http\Middleware\TrustHosts

Extends

Class Description
TrustHosts

Properties

inherited protected $app : Illuminate\Contracts\Foundation\Application

Inherited from TrustHosts

The application instance.

Methods

public hosts () : array

Get the host patterns that should be trusted.

Trusted hosts should be defined in the config/app.php configuration file as an array, ie.:

'trustedHosts' => [ 'example.com', // Matches just example.com 'www.example.com', // Matches just www.example.com '^(.+.)?example.com$', // Matches example.com and all subdomains 'https://example.com', // Matches just example.com ],

or as a boolean - if true, it will trust the app.url host and all subdomains, if false it will disable the feature entirely.

Hosts can be defined as regex patterns for complex matching.

Returns
array

public static processTrustedHosts (array | bool $hosts) : array

Processes the trusted hosts into an array of patterns the match for host header checks.

Parameters
Property Description
$hosts
array | bool
Returns
array

inherited public __construct (Illuminate\Contracts\Foundation\Application $app) : void

Inherited from TrustHosts

Create a new middleware instance.

Parameters
Property Description
$app
Illuminate\Contracts\Foundation\Application
Returns
void

inherited public handle (Illuminate\Http\Request $request, callable $next) : Illuminate\Http\Response

Inherited from TrustHosts

Handle the incoming request.

Parameters
Property Description
$request
Illuminate\Http\Request
$next
callable
Returns
Illuminate\Http\Response

inherited protected allSubdomainsOfApplicationUrl () : string | null

Inherited from TrustHosts

Get a regular expression matching the application URL and all of its subdomains.

Returns
string | null

inherited protected shouldSpecifyTrustedHosts () : bool

Inherited from TrustHosts

Determine if the application should specify trusted hosts.

Returns
bool
Copyright © 2024 Winter CMS