Explorar o código

Optimization chunked

walkor %!s(int64=2) %!d(string=hai) anos
pai
achega
7a4aa1ebee
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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