private function replaceHostHeader(UriInterface $uri)
    {
        $host = $uri->getHost();

        if (!empty($host)) {

            $port = $uri->getPort();
            if (!empty($port)) {
                $host .= ':' . $port;
            }

            //~ Ensure Host is the first header. See: http://tools.ietf.org/html/rfc7230#section-5.4
            $this->headersOriginal = ['Host' => [$host]] + $this->headersOriginal;
            $this->headers         = ['host' => [$host]] + $this->headers;
        }
    }
private function replaceHostHeader(UriInterface $uri)
    {
        $host = $uri->getHost();

        if (!empty($host)) {

            $port = $uri->getPort();
            if (!empty($port)) {
                $host .= ':' . $port;
            }

            //~ Ensure Host is the first header. See: http://tools.ietf.org/html/rfc7230#section-5.4
            $this->headersOriginal = ['Host' => [$host]] + $this->headersOriginal;
            $this->headers         = ['host' => [$host]] + $this->headers;
        }
    }
private function replaceHostHeader ( UriInterface $ uri ) { $ host = $ uri -> getHost ( ) ; if ( ! empty ( $ host ) ) { $ port = $ uri -> getPort ( ) ; if ( ! empty ( $ port ) ) { $ host .= ':' . $ port ; } //~ Ensure Host is the first header. See: http://tools.ietf.org/html/rfc7230#section-5.4 $ this -> headersOriginal = [ 'Host' => [ $ host ] ] + $ this -> headersOriginal ; $ this -> headers = [ 'host' => [ $ host ] ] + $ this -> headers ; } }
Update host header if host is not empty.

@param  UriInterface $uri
@return void
Update host header if host is not empty .