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:
parent
79c92603f5
commit
a385b6736c
1 changed files with 1 additions and 0 deletions
|
|
@ -210,6 +210,7 @@ proc processClient(client: AsyncSocket, address: string,
|
||||||
var contentLength = 0
|
var contentLength = 0
|
||||||
if parseInt(request.headers["Content-Length"], contentLength) == 0:
|
if parseInt(request.headers["Content-Length"], contentLength) == 0:
|
||||||
await request.respond(Http400, "Bad Request. Invalid Content-Length.")
|
await request.respond(Http400, "Bad Request. Invalid Content-Length.")
|
||||||
|
continue
|
||||||
else:
|
else:
|
||||||
request.body = await client.recv(contentLength)
|
request.body = await client.recv(contentLength)
|
||||||
assert request.body.len == contentLength
|
assert request.body.len == contentLength
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue