Skip to content

Commit

Permalink
Add HTTP 308 moved permanently (RFC 7538) (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
ke4roh authored and spaceone committed Feb 11, 2017
1 parent 589e6b0 commit 351410d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion circuits/web/errors.py
Expand Up @@ -162,7 +162,7 @@ def __init__(self, request, response, urls, code=None):

super(redirect, self).__init__(request, response, code)

if code in (300, 301, 302, 303, 307):
if code in (300, 301, 302, 303, 307, 308):
response.headers["Content-Type"] = "text/html"
# "The ... URI SHOULD be given by the Location field
# in the response."
Expand All @@ -180,6 +180,8 @@ def __init__(self, request, response, urls, code=None):
"<a href='%s'>%s</a>."),
307: ("This resource has moved temporarily to "
"<a href='%s'>%s</a>."),
308: ("This resource has permanently moved to "
"<a href='%s'>%s</a>."),
}[code]
response.body = "<br />\n".join([msg % (u, u) for u in urls])
# Previous code may have set C-L, so we have to reset it
Expand Down

0 comments on commit 351410d

Please sign in to comment.