summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2017-07-28 19:33:09 +0100
committerGitHub <noreply@github.com>2017-07-28 19:33:09 +0100
commitc3d5464e6fa3c5f902f160a5d9091d914398c376 (patch)
tree415e8e8bf2f2756fc18eb3be61f12aa2d043e0d2 /lib/pure
parente8f7d605f6475f0a386d517596578f99ce2431af (diff)
parentbcdc5ddd37d241a70ee91f0dac29ff868c989b1a (diff)
downloadNim-c3d5464e6fa3c5f902f160a5d9091d914398c376.tar.gz
Merge pull request #6143 from xxlabaza/correct_no_content_length_response
Correct "Length required" response status code and phrase
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/asynchttpserver.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/asynchttpserver.nim b/lib/pure/asynchttpserver.nim
index a374e80e8..b7b57a82f 100644
--- a/lib/pure/asynchttpserver.nim
+++ b/lib/pure/asynchttpserver.nim
@@ -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.