protected function setUri(UriInterface $uri, $preserveHost = false)
    {
        if (! $preserveHost && $uri->getHost() !== '') {
            $key = $this->headerKey('Host');
            $this->headers[$key] = [$uri->getHost()];
        }

        $this->uri = $uri;
    }