function Request::setTrustedHosts
Sets a list of trusted host patterns.
You should only list the hosts you manage using regexs.
Parameters
array $hostPatterns A list of trusted host patterns:
2 calls to Request::setTrustedHosts()
- DrupalKernel::setupTrustedHosts in core/
lib/ Drupal/ Core/ DrupalKernel.php - Sets up the lists of trusted HTTP Host headers.
- Kernel::preBoot in vendor/
symfony/ http-kernel/ Kernel.php
File
-
vendor/
symfony/ http-foundation/ Request.php, line 586
Class
- Request
- Request represents an HTTP request.
Namespace
Symfony\Component\HttpFoundationCode
public static function setTrustedHosts(array $hostPatterns) : void {
self::$trustedHostPatterns = array_map(fn($hostPattern) => \sprintf('{%s}i', $hostPattern), $hostPatterns);
// we need to reset trusted hosts on trusted host patterns change
self::$trustedHosts = [];
}