Skip to content

Commit

Permalink
check content-length header exists
Browse files Browse the repository at this point in the history
  • Loading branch information
guzba committed Nov 23, 2021
1 parent c9a1cd7 commit d896a07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/debug_server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit d896a07

Please sign in to comment.