walkor 3 years ago
parent
commit
39df5a1627
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Protocols/Http/Request.php

+ 1 - 1
Protocols/Http/Request.php

@@ -224,7 +224,7 @@ class Request
     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;