TrustedHostsRequestFactory

class TrustedHostsRequestFactory

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.

Hierarchy