Kaynağa Gözat

Optimization chunked

walkor 2 yıl önce
ebeveyn
işleme
7a4aa1ebee
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      src/Protocols/Http/Response.php

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

@@ -468,7 +468,7 @@ class Response
         if (!isset($headers['Transfer-Encoding'])) {
             $head .= "Content-Length: $bodyLen\r\n\r\n";
         } else {
-            return "$head\r\n" . dechex($bodyLen) . "\r\n$this->body\r\n";
+            return $bodyLen ? "$head\r\n" . dechex($bodyLen) . "\r\n{$this->body}\r\n" : "$head\r\n";
         }
 
         // The whole http package