diff --git a/Uri/Http.php b/Uri/Http.php index 4c9e72624..6e6046894 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -174,7 +174,7 @@ final class Http implements UriInterface $this->query = \array_change_key_case($this->query, CASE_LOWER); $this->fragment = $url['fragment'] ?? ''; - $this->base = $this->scheme . '://' . $this->host . $this->rootPath; + $this->base = $this->scheme . '://' . $this->host . ($this->port !== 80 ? ':' . $this->port : '') . $this->rootPath; } /**