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:
Dominik Picheta
2015-06-03 18:48:55 +01:00
parent 79c92603f5
commit a385b6736c

View File

@@ -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