Skip to content

Commit

Permalink
httpcore: Add http code 308 Permanent Redirect (#14639)
Browse files Browse the repository at this point in the history
* httpcore: Add http code 308
* httpclient: Add 308 to redirection proc
* fix typo
  • Loading branch information
daniel-j authored Jun 12, 2020
1 parent 67d3436 commit 1168c75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pure/httpclient.nim
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ proc sendFile(socket: Socket | AsyncSocket,
file.close()

proc redirection(status: string): bool =
const redirectionNRs = ["301", "302", "303", "307"]
const redirectionNRs = ["301", "302", "303", "307", "308"]
for i in items(redirectionNRs):
if status.startsWith(i):
return true
Expand Down
2 changes: 2 additions & 0 deletions lib/pure/httpcore.nim
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const
Http304* = HttpCode(304)
Http305* = HttpCode(305)
Http307* = HttpCode(307)
Http308* = HttpCode(308)
Http400* = HttpCode(400)
Http401* = HttpCode(401)
Http403* = HttpCode(403)
Expand Down Expand Up @@ -272,6 +273,7 @@ proc `$`*(code: HttpCode): string =
of 304: "304 Not Modified"
of 305: "305 Use Proxy"
of 307: "307 Temporary Redirect"
of 308: "308 Permanent Redirect"
of 400: "400 Bad Request"
of 401: "401 Unauthorized"
of 403: "403 Forbidden"
Expand Down

0 comments on commit 1168c75

Please sign in to comment.