TrustedHostsRequestFactory
class TrustedHostsRequestFactory (View source)
Provides a request factory for requests using host verification.
Because the trusted host patterns for requests are stored statically, they are consulted even for fake request created with Request::create(), whose host is 'localhost' by default. Such requests would fail host verification unless 'localhost' matches one of the trusted host patterns. To circumvent this problem, this factory injects the server variables from the main request into each newly created request, so that the host is correctly set even for fake requests and they properly pass host verification.
Properties
| protected string | $host | The host of the main request. |
Methods
Creates a new TrustedHostsRequestFactory.
Creates a new request object.
Details
__construct(string $host)
Creates a new TrustedHostsRequestFactory.
Request
createRequest(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], string $content = NULL)
Creates a new request object.