mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-20 07:51:32 +00:00
httpcore: Add http code 308 Permanent Redirect (#14639)
* httpcore: Add http code 308 * httpclient: Add 308 to redirection proc * fix typo
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user