src/Http/Request.php
public function withUri(UriInterface $uri, $preserveHost = false)
    {
        $this->uri = $uri;

        if (!$preserveHost) {
            if ($uri->getHost()) {
                $this->addHostHeader($uri);
            }
        }

        return $this;
    }
public function withUri(UriInterface $uri, $preserveHost = false)
    {
        $this->uri = $uri;

        if (!$preserveHost) {
            if ($uri->getHost()) {
                $this->addHostHeader($uri);
            }
        }

        return $this;
    }
{@inheritdoc}