fix broken content type being 0

This commit is contained in:
William Bell committed 2023-08-01 11:20:06 +02:00
1 parent 362eb3ad06
commit c682fb599d
1 file changed
+2 -2
+2 -2
View File
@@ -22,10 +22,10 @@ let parse(conn) = do
let body = buffer()
if (method in methodsWithBody) do
let contentLength = 0
let contentLength = -1
if ("content-length" in headers) do
contentLength = number(headers["content-length"])
while ((not conn.isClosed()) && (body.length < contentLength || contentLength == 0)) do
while ((not conn.isClosed()) && (body.length < contentLength || contentLength == -1)) do
try do
let chunk = conn.read(readChunkSize)
if (chunk.length == 0) break