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
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.
public static processTrustedHosts (array | bool $hosts) : array
Processes the trusted hosts into an array of patterns the match for host header checks.
Property | Type | Description |
---|---|---|
$hosts | array | bool |
array | bool
|
inherited public __construct (Illuminate\Contracts\Foundation\Application $app) : void
Create a new middleware instance.
Property | Type | Description |
---|---|---|
$app | Illuminate\Contracts\Foundation\Application |
Illuminate\Contracts\Foundation\Application
|
inherited public handle (Illuminate\Http\Request $request, callable $next) : Illuminate\Http\Response
Handle the incoming request.
Property | Type | Description |
---|---|---|
$request | Illuminate\Http\Request |
Illuminate\Http\Request
|
$next | callable |
callable
|
inherited protected allSubdomainsOfApplicationUrl () : string | null
Get a regular expression matching the application URL and all of its subdomains.
inherited protected shouldSpecifyTrustedHosts () : bool
Determine if the application should specify trusted hosts.