Răsfoiți Sursa

Fix for DELETE requests that keep the connection hanging

When a `DELETE` request is made without **Content-Length** header, it makes the connection hanging without a response
This commit makes sure we don't return 0 for **getRequestSize** method when it is a delete request.

Following request is an example to showcase this bug

```
DELETE /examples/_007_crud/authors/1 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: localhost:8080
Connection: close
```
Arul 7 ani în urmă
părinte
comite
c0248ba499
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      Protocols/Http.php

+ 1 - 1
Protocols/Http.php

@@ -73,7 +73,7 @@ class Http
             $content_length = isset($match[1]) ? $match[1] : 0;
             return $content_length + strlen($header) + 4;
         }
-        return 0;
+        return $method === 'DELETE' ? strlen($header) + 4 : 0;
     }
 
     /**