Returns the host header.

@param UriInterface $uri

@return string
761281
private function buildHost(UriInterface $uri): string
    {
        return $uri->getHost().($uri->getPort() !== null ? ':'.$uri->getPort() : '');
    }
910074
public static function getDomain($uri)
    {
        $returnValue = parse_url($uri, PHP_URL_HOST);
        if (empty($returnValue)) {
            return null;
        }

        return $returnValue;
    }
1064977
protected function hostToAscii($uri)
    {
        static $modifier;
        if (null === $modifier) {
            $modifier = new HostToAscii();
        }

        return $modifier->process($uri);
    }
1058112
public function getUri($uri) {
        $curieSeperator = ':';

        if (preg_match('/http(s*)\:\/\//', $uri) == false) {
            if (strpos($uri, $curieSeperator) !== false) {
                list($prefix, $action) = explode($curieSeperator, $uri);
                
                if(isset($this->WAMP->prefixes[$prefix]) === true){
                  return $this->WAMP->prefixes[$prefix] . '#' . $action;
                }
            }
        }

        return $uri;
    }
689731
protected function updateOptions(UriInterface $uri)
    {
        $query = $this->options['query'];
        if ($this->options['reuseParams']) {
            $query = array_merge(
                $query,
                $this->request->getQueryParams()
            );
        }
        $queryString = http_build_query($query);
        $uri = $uri->withQuery($queryString);
        return $this->updateHostName($uri);
    }
437845
public static function hostToAscii($uri)
    {
        return $uri->withHost((string) (new Host(self::filterUri($uri)->getHost())));
    }
1243025
def get_header(uri):
    
    if uri not in astheaders:
        astheaders[uri] = get_hdu(uri, cutout="[1:1,1:1]")[0].header
    return astheaders[uri]
1058833
public function baseUrl($uri = '')
    {
        return sprintf(
            "%s://%s%s%s%s",
            isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
            $_SERVER['SERVER_NAME'],
            ($_SERVER['SERVER_PORT'] == 80) ?: ':' . $_SERVER['SERVER_PORT'],
            $_SERVER['REQUEST_URI'],
            ltrim($uri, '/')
        );
    }
7972
function getHeader($header)
    {
        if (! $this->hasHeader($header)) {
            if (strtolower($header) === 'host'
                && ($this->uri && $this->uri->getHost())
            )
                return array($this->_getHostFromUri());

            return array();
        }

        $header = $this->_c_headerNormalized[strtolower($header)];
        $value  = $this->headers[$header];
        $value  = is_array($value) ? $value : array($value);
        return $value;
    }
1077544
public function extractHostname( $uri )
    {
        $hostname = false;

        $parts = parse_url( $uri );

        if ( isset( $parts['host'] ) )
            $hostname = $parts['host'];

        return $hostname;
    }
974026
public static String getHost(final URI uri) throws NormalizationException {
        final String host = Strings.emptyToNull(uri.getHost());
        if (host == null) {
            throw new NormalizationException(uri.toString(), "No host in URI");
        }
        return host;
    }
800252
protected function _getHostFromUri()
    {
        $host  = $this->uri->getHost();
        $host .= $this->uri->getPort() ? ':' . $this->uri->getPort() : '';
        return $host;
    }
983615
private function getHostWithScheme(UriInterface $url)
    {
        $target = new Uri();
        $target = $target
            ->withScheme($url->getScheme())
            ->withHost($url->getHost())
            ->withPort($url->getPort());

        return (string) $target;
    }
527889
public function withUri(UriInterface $uri, $preserveHost = false)
        {
            $clone = clone $this;
            $clone->uri = $uri;
            $host = $uri->getHost();

            if (!$preserveHost) {
                $clone->headers['host'] = $this->setNotPreserveHost($host);
            } else {

                $headerHost = $this->getHeaderLine('Host');
                $clone->headers['host'] = $this->setPreserveHost($headerHost, $host);

            }
            return $clone;
        }
823632
protected function getHostFromRequest(RequestInterface $request): string
    {
        $host = trim($request->getUri()->getHost(), '/');

        if (array_key_exists($host, $this->domainAliases)) {
            return $this->domainAliases[$host];
        }

        return $host;
    }
1335271
public function toBrandApi(string $uri = ''): string
    {
        if (!($host = $this->App->Config->©brand['§api_domain'])) {
            throw $this->c::issue('Missing brand API domain.');
        }
        $uri = $uri ? $this->c::mbLTrim($uri, '/') : '';
        $uri = $uri ? '/'.$uri : ''; // Force leading slash.

        $base_path = $this->App->Config->©brand['§api_domain_path'];
        $base_path = $base_path && $uri ? $this->c::mbRTrim($base_path, '/') : $base_path;

        return $url = 'https://'.$host.$base_path.$uri;
    }
808293
public function toContainer(string $uri = ''): string
    {
        $uri = $uri ? $this->c::mbLTrim($uri, '/') : '';
        $uri = $uri ? '/'.$uri : ''; // Force leading slash.

        return $url = 'https://'.$this->App::CORE_CONTAINER_DOMAIN.$uri;
    }