From d896a071937b168e011a873352f32164ec255eac Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Tue, 23 Nov 2021 16:47:26 -0600 Subject: [PATCH] check content-length header exists --- tests/debug_server.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/debug_server.nim b/tests/debug_server.nim index c94e1dd..af192e5 100644 --- a/tests/debug_server.nim +++ b/tests/debug_server.nim @@ -29,7 +29,10 @@ proc cb(req: Request) {.async.} = return if req.url.path == "/post": - await req.respond(Http200, req.body) + if req.headers["Content-Length"] == "": + await req.respond(Http200, "missing content-length header") + else: + await req.respond(Http200, req.body) return if req.url.path == "/url":