From 39df5a1627345678e8b83ac86efabafdf31ca9d5 Mon Sep 17 00:00:00 2001 From: walkor Date: Wed, 23 Mar 2022 10:14:58 +0800 Subject: [PATCH] host --- Protocols/Http/Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Protocols/Http/Request.php b/Protocols/Http/Request.php index 3ec327c7c..7c36974fb 100644 --- a/Protocols/Http/Request.php +++ b/Protocols/Http/Request.php @@ -224,7 +224,7 @@ public function protocolVersion() public function host($without_port = false) { $host = $this->header('host'); - if ($without_port && $pos = \strpos($host, ':')) { + if ($host && $without_port && $pos = \strpos($host, ':')) { return \substr($host, 0, $pos); } return $host;