diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-06-03 18:48:55 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-06-03 18:48:55 +0100 |
commit | a385b6736cc76b94658097fa7f7ae01beb4fba57 (patch) | |
tree | 4cf7d1b7a4a5ce3406ae5178e7672debf7673843 | |
parent | 79c92603f505c388d370c5ef0dd8890e4e17e4e0 (diff) | |
download | Nim-a385b6736cc76b94658097fa7f7ae01beb4fba57.tar.gz |
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.
-rw-r--r-- | lib/pure/asynchttpserver.nim | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/pure/asynchttpserver.nim b/lib/pure/asynchttpserver.nim index 279cedb5d..9e036443c 100644 --- a/lib/pure/asynchttpserver.nim +++ b/lib/pure/asynchttpserver.nim @@ -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 |