mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 19:52:36 +00:00
Fix incorrect 400 reply in asynchttpserver
Without the ``continue`` the user's callback will be called but the client would have already been replied to.
This commit is contained in:
@@ -210,6 +210,7 @@ proc processClient(client: AsyncSocket, address: string,
|
||||
var contentLength = 0
|
||||
if parseInt(request.headers["Content-Length"], contentLength) == 0:
|
||||
await request.respond(Http400, "Bad Request. Invalid Content-Length.")
|
||||
continue
|
||||
else:
|
||||
request.body = await client.recv(contentLength)
|
||||
assert request.body.len == contentLength
|
||||
|
||||
Reference in New Issue
Block a user