diff --git a/src/Pecee/Http/Url.php b/src/Pecee/Http/Url.php index 4bd2647..9ba71ac 100644 --- a/src/Pecee/Http/Url.php +++ b/src/Pecee/Http/Url.php @@ -164,6 +164,11 @@ public function getHost(bool $includeTrails = false): ?string */ public function setHost(string $host): self { + // Strip any potential ports from hostname + if (strpos($host, ':') !== false) { + $host = strstr($host, strrchr($host, ':'), true); + } + $this->host = $host; return $this;