From b39f23574f138acd97420c3a7d5061833fa00d83 Mon Sep 17 00:00:00 2001 From: Oliver Etchebarne Date: Thu, 19 Oct 2023 11:45:24 -0500 Subject: [PATCH] Fix: Index error on connections without HTTP_HOST --- src/Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Request.php b/src/Request.php index efeb096..f253bbf 100644 --- a/src/Request.php +++ b/src/Request.php @@ -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); }