Forráskód Böngészése

Merge pull request #780 from topyao/patch-1

修复PHP Warning:  Undefined array key警告
walkor 3 éve
szülő
commit
d49fddea18
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      src/Protocols/Http/Response.php

+ 1 - 1
src/Protocols/Http/Response.php

@@ -409,7 +409,7 @@ class Response
             return $this->createHeadForFile($this->file);
         }
 
-        $reason = $this->_reason ?: static::$_phrases[$this->_status];
+        $reason = $this->_reason ?: static::$_phrases[$this->_status] ?? '';
         $body_len = \strlen($this->_body);
         if (empty($this->_header)) {
             return "HTTP/{$this->_version} {$this->_status} $reason\r\nServer: workerman\r\nContent-Type: text/html;charset=utf-8\r\nContent-Length: $body_len\r\nConnection: keep-alive\r\n\r\n{$this->_body}";