asynchttpserver's Response object's req method uses HttpMethod now.

Fixes #4423.
This commit is contained in:
Dominik Picheta 2016-09-25 00:39:57 +02:00
commit 26c7a76c8a
4 changed files with 25 additions and 15 deletions

View file

@ -226,7 +226,7 @@ proc `$`*(code: HttpCode): string =
## For example:
##
## .. code-block:: nim
## doAssert(Http404.status == "404 Not Found")
## doAssert($Http404 == "404 Not Found")
case code.int
of 100: "100 Continue"
of 101: "101 Switching Protocols"
@ -298,6 +298,9 @@ proc is5xx*(code: HttpCode): bool =
## Determines whether ``code`` is a 5xx HTTP status code.
return code.int in {500 .. 599}
proc `$`*(httpMethod: HttpMethod): string =
return (system.`$`(httpMethod))[4 .. ^1].toUpper()
when isMainModule:
var test = newHttpHeaders()
test["Connection"] = @["Upgrade", "Close"]