Support 308 Permanent Redirect HTTP redirect#1794
Support 308 Permanent Redirect HTTP redirect#1794webknjaz merged 3 commits intocherrypy:masterfrom ingoogni:ingoogni-redirect-308
Conversation
|
Thanks for your contribution @ingoogni! FTR I've just restarted a failed job on AppVeyor (and it's green now). May I ask you to add a test case covering this change, please? |
This comment has been minimized.
This comment has been minimized.
webknjaz
left a comment
There was a problem hiding this comment.
Should the default_status property be also updated?
|
Thank @webknjaz Regarding default_status, for what I found 308 is either implemented properly in browsers / clients or not at all. I wouldn't add 308 to the default_redirect. If 308 is not implemented the client should fall back on their unknown status procedure and just render the message. |
|
Apparently, the status text is I've also checked the client behavior and found out that there's no user confirmation on the browser side so I've corrected that too. |
``raise cherrypy.HTTPRedirect('/new_uri', 308)``
is now recognized as a legitimate redirect
Refs:
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308#Status
* https://tools.ietf.org/html/rfc7538#section-3
* https://airbrake.io/blog/http-errors/308-permanent-redirect
* https://stackoverflow.com/a/42138726/595220
|
Thanks @ingoogni! |
|
Thanks @webknjaz |
Recognize
raise cherrypy.HTTPRedirect('/new_uri', 308)as a legitimate redirect.Refs:
What kind of change does this PR introduce?
What is the related issue number (starting with
#)N/A
What is the current behavior? (You can also link to an open issue here)
raise cherrypy.HTTPRedirect('/new_uri', 308)is not recognized as a redirect and causes aValueErrorWhat is the new behavior (if this is a feature change)?
raise cherrypy.HTTPRedirect('/new_uri', 308)works the same way as other HTTP codes for redirection.Other information:
N/A
Checklist:
and description in grammatically correct, complete sentences