walkor 3 年之前
父節點
當前提交
39df5a1627
共有 1 個文件被更改,包括 1 次插入1 次删除
  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;