public function getHostInfo()
    {
        if ($this->_hostInfo === null) {
            $secure = $this->getIsSecureConnection();
            $http = $secure ? 'https' : 'http';
            $serverName = $this->getServerParam('SERVER_NAME');

            if ($this->getHeaders()->has('X-Forwarded-Host')) {
                $this->_hostInfo = $http . '://' . $this->getHeaders()->get('X-Forwarded-Host');
            } elseif ($this->getHeaders()->has('Host')) {
                $this->_hostInfo = $http . '://' . $this->getHeaders()->get('Host');
            } elseif (isset($serverName)) {
                $this->_hostInfo = $http . '://' . $serverName;
                $port = $secure ? $this->getSecurePort() : $this->getPort();
                if (($port !== 80 && !$secure) || ($port !== 443 && $secure)) {
                    $this->_hostInfo .= ':' . $port;
                }
            }
        }

        return $this->_hostInfo;
    }