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

		if (!$preserveHost && ($host = $uri->getHost())) {
			if ($uri->getPort() !== null) {
				$host .= URI::DELIMITER_PORT . $uri->getPort();
			}

			$this->setHeader('Host', $host);
		}

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

		if (!$preserveHost && ($host = $uri->getHost())) {
			if ($uri->getPort() !== null) {
				$host .= URI::DELIMITER_PORT . $uri->getPort();
			}

			$this->setHeader('Host', $host);
		}

		return $this;
	}
Set the uri.

@param UriInterface $uri
@param bool $preserveHost = false
@return $this