Merge pull request #6143 from xxlabaza/correct_no_content_length_response
Correct "Length required" response status code and phrase
This commit is contained in:
commit
c3d5464e6f
1 changed files with 2 additions and 2 deletions
|
|
@ -127,7 +127,7 @@ proc parseProtocol(protocol: string): tuple[orig: string, major, minor: int] =
|
|||
i.inc protocol.parseInt(result.minor, i)
|
||||
|
||||
proc sendStatus(client: AsyncSocket, status: string): Future[void] =
|
||||
client.send("HTTP/1.1 " & status & "\c\L\c\L")
|
||||
client.send("HTTP/1.1 " & status & "\c\L\c\L")
|
||||
|
||||
proc processClient(client: AsyncSocket, address: string,
|
||||
callback: proc (request: Request):
|
||||
|
|
@ -233,7 +233,7 @@ proc processClient(client: AsyncSocket, address: string,
|
|||
await request.respond(Http400, "Bad Request. Content-Length does not match actual.")
|
||||
continue
|
||||
elif request.reqMethod == HttpPost:
|
||||
await request.respond(Http400, "Bad Request. No Content-Length.")
|
||||
await request.respond(Http411, "Content-Length required.")
|
||||
continue
|
||||
|
||||
# Call the user's callback.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue