Skip to content

Commit

Permalink
Merge pull request #695 from skipperbent/v5-development
Browse files Browse the repository at this point in the history
Version 5.4.1.3
  • Loading branch information
skipperbent authored Nov 27, 2023
2 parents d75af21 + 565a926 commit 14c2199
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/Pecee/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ public function setUrl(Url $url): void
*/
public function setHost(?string $host): void
{
// Strip any potential ports from hostname
if (strpos($host, ':') !== false) {
$host = strstr($host, strrchr($host, ':'), true);
}

$this->host = $host;
}

Expand Down
5 changes: 0 additions & 5 deletions src/Pecee/Http/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ 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;
Expand Down

0 comments on commit 14c2199

Please sign in to comment.