Skip to content

Commit

Permalink
Fix: Index error on connections without HTTP_HOST
Browse files Browse the repository at this point in the history
  • Loading branch information
drmad committed Oct 19, 2023
1 parent 75beb88 commit b39f235
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function fromPHP(): self
$parsed_url = parse_url(ltrim($_SERVER['REQUEST_URI'], '/'));

// Si $host trae puerto, lo ignoramos
$host = $_SERVER['HTTP_HOST'];
$host = $_SERVER['HTTP_HOST'] ?? '';
if (($colon_post = strpos($host, ':')) !== false) {
$host = substr($host, 0, $colon_post);
}
Expand Down

0 comments on commit b39f235

Please sign in to comment.