Permalink
Browse files

Add HTTP 308 moved permanently (RFC 7538) (#224)

  • Loading branch information...
1 parent 589e6b0 commit 351410dc14bec53d658528e7758552a2e854500c @ke4roh ke4roh committed with spaceone Feb 11, 2017
Showing with 3 additions and 1 deletion.
  1. +3 −1 circuits/web/errors.py
@@ -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."
@@ -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

0 comments on commit 351410d

Please sign in to comment.