Reverted removal of HttpCode.$.
This commit is contained in:
parent
519aa16b67
commit
31bdf45ffe
2 changed files with 2 additions and 5 deletions
|
|
@ -216,7 +216,7 @@ proc `==`*(protocol: tuple[orig: string, major, minor: int],
|
||||||
proc contains*(methods: set[HttpMethod], x: string): bool =
|
proc contains*(methods: set[HttpMethod], x: string): bool =
|
||||||
return parseEnum[HttpMethod](x) in methods
|
return parseEnum[HttpMethod](x) in methods
|
||||||
|
|
||||||
proc status*(code: HttpCode): string =
|
proc `$`*(code: HttpCode): string =
|
||||||
## Converts the specified ``HttpCode`` into a HTTP status.
|
## Converts the specified ``HttpCode`` into a HTTP status.
|
||||||
##
|
##
|
||||||
## For example:
|
## For example:
|
||||||
|
|
@ -276,7 +276,7 @@ proc status*(code: HttpCode): string =
|
||||||
proc `==`*(a, b: HttpCode): bool {.borrow.}
|
proc `==`*(a, b: HttpCode): bool {.borrow.}
|
||||||
|
|
||||||
proc `==`*(rawCode: string, code: HttpCode): bool =
|
proc `==`*(rawCode: string, code: HttpCode): bool =
|
||||||
return rawCode.toLower() == code.status.toLower()
|
return rawCode.toLower() == ($code).toLower()
|
||||||
|
|
||||||
proc is2xx*(code: HttpCode): bool =
|
proc is2xx*(code: HttpCode): bool =
|
||||||
## Determines whether ``code`` is a 2xx HTTP status code.
|
## Determines whether ``code`` is a 2xx HTTP status code.
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,6 @@ that have tuple name:
|
||||||
|
|
||||||
- ``AsyncHttpClient.headers`` type is now ``HttpHeaders``.
|
- ``AsyncHttpClient.headers`` type is now ``HttpHeaders``.
|
||||||
|
|
||||||
- The `$` operator for ``HttpCode`` no longer exists, use the ``status``
|
|
||||||
procedure to get the code's status message.
|
|
||||||
|
|
||||||
Library Additions
|
Library Additions
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue