Skip to content

Commit

Permalink
If host don't have port, by default is 80
Browse files Browse the repository at this point in the history
  • Loading branch information
joanhey committed Jun 4, 2024
1 parent 3e3c3ad commit 9832495
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,9 @@ public static function decode(string $recv_buffer, TcpConnection $connection): v
case 'HOST':
$tmp = \explode(':', $value);
$_SERVER['SERVER_NAME'] = $tmp[0];
if (isset($tmp[1])) {
$_SERVER['SERVER_PORT'] = $tmp[1];
}
$_SERVER['SERVER_PORT'] = $tmp[1] ?? 80;
break;
// cookie
// cookie
case 'COOKIE':
\parse_str(\str_replace('; ', '&', $_SERVER['HTTP_COOKIE']), $_COOKIE);
break;
Expand Down

0 comments on commit 9832495

Please sign in to comment.