asynchttpserver's Response object's req method uses HttpMethod now.
Fixes #4423.
This commit is contained in:
parent
6a83bc1ff5
commit
26c7a76c8a
4 changed files with 25 additions and 15 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue