parent
d02486aa48
commit
159643824b
4 changed files with 36 additions and 29 deletions
|
|
@ -285,7 +285,7 @@ proc `$`*(code: HttpCode): string =
|
|||
proc `==`*(a, b: HttpCode): bool {.borrow.}
|
||||
|
||||
proc `==`*(rawCode: string, code: HttpCode): bool =
|
||||
return rawCode.toLower() == ($code).toLower()
|
||||
return cmpIgnoreCase(rawCode, $code) == 0
|
||||
|
||||
proc is2xx*(code: HttpCode): bool =
|
||||
## Determines whether ``code`` is a 2xx HTTP status code.
|
||||
|
|
@ -304,7 +304,7 @@ proc is5xx*(code: HttpCode): bool =
|
|||
return code.int in {500 .. 599}
|
||||
|
||||
proc `$`*(httpMethod: HttpMethod): string =
|
||||
return (system.`$`(httpMethod))[4 .. ^1].toUpper()
|
||||
return (system.`$`(httpMethod))[4 .. ^1].toUpperAscii()
|
||||
|
||||
when isMainModule:
|
||||
var test = newHttpHeaders()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue