Request::getHost()

string getHost()

Returns the host name.

This method can read the client host name from the "X-Forwarded-Host" header when trusted proxies were set via "setTrustedProxies()".

The "X-Forwarded-Host" header must contain the client host name.

If your reverse proxy uses a different header name than "X-Forwarded-Host", configure it via "setTrustedHeaderName()" with the "client-host" key.

Return Value

string

Exceptions

UnexpectedValueException when the host name is invalid
doc_Symfony
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.