Webiny\Component\Http\Request::getHostName PHP Method

getHostName() public method

This function check the forwarded headers from trusted proxies.
public getHostName ( ) : string
return string Host name
    public function getHostName()
    {
        $remoteAddress = $this->server()->remoteAddress();
        $host = $this->server()->serverName();
        $fwdHost = $this->server()->get($this->getTrustedHeaders()['client_host']);
        if ($fwdHost && $fwdHost != '' && in_array($remoteAddress, $this->getTrustedProxies())) {
            $host = $fwdHost;
        }
        return strtolower($host);
    }