Skip to content

Commit 4b1da6b

Browse files
authored
Merge pull request #13 from phpugph/1.0
fixing cases for localhost with port
2 parents a130d68 + 48df0e1 commit 4b1da6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/IO/Request/ServerTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function setHost(string $protocol)
163163
$uri = $this->getServer('REQUEST_URI');
164164

165165
$hostname = sprintf('%s://%s', $protocol, $host);
166-
if ($port != 80 && $port != 443) {
166+
if (strpos($host ?? '', ':') === false && $port != 80 && $port != 443) {
167167
$hostname .= ':' . $port;
168168
}
169169

0 commit comments

Comments
 (0)