class AllowedHostsMiddleware implements HTTPMiddleware (View source)

Secures requests by only allowing a whitelist of Host values

Methods

public
array
getAllowedHosts()

No description

public
$this
setAllowedHosts(array|string $allowedHosts)

Sets the list of allowed Host header values Can also specify a comma separated list

public
process(HTTPRequest $request, callable $delegate)

No description

Details

array getAllowedHosts()

No description

Return Value

array

List of allowed Host header values

$this setAllowedHosts(array|string $allowedHosts)

Sets the list of allowed Host header values Can also specify a comma separated list

Parameters

array|string $allowedHosts

Return Value

$this

HTTPResponse process(HTTPRequest $request, callable $delegate)

No description

Parameters

HTTPRequest $request
callable $delegate

Return Value

HTTPResponse