From c682fb599da4012a688ceec9dc37cec5cb57e3bb Mon Sep 17 00:00:00 2001 From: William Bell Date: Tue, 1 Aug 2023 11:20:06 +0200 Subject: [PATCH] fix broken content type being 0 --- src/parseRequest.ar | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parseRequest.ar b/src/parseRequest.ar index a29aeff..202a31a 100644 --- a/src/parseRequest.ar +++ b/src/parseRequest.ar @@ -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