rename resume/resume_incomplete to permanent_redirect according to rfc7238

Use temporary_redirect intead of temporary_moved to make the words
line up nicely ;-)
This commit is contained in:
Eric L Frederich
2014-06-11 11:08:10 -04:00
parent 07d9b730b7
commit ec3a2e6f04
3 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -35,11 +35,11 @@ from .status_codes import codes
#: The set of HTTP status codes that indicate an automatically
#: processable redirect.
REDIRECT_STATI = (
codes.moved, # 301
codes.found, # 302
codes.other, # 303
codes.temporary_moved, # 307
codes.resume, # 308
codes.moved, # 301
codes.found, # 302
codes.other, # 303
codes.temporary_redirect, # 307
codes.permanent_redirect, # 308
)
DEFAULT_REDIRECT_LIMIT = 30
CONTENT_CHUNK_SIZE = 10 * 1024
+1 -1
View File
@@ -146,7 +146,7 @@ class SessionRedirectMixin(object):
prepared_request.method = method
# https://github.com/kennethreitz/requests/issues/1084
if resp.status_code not in (codes.temporary, codes.resume):
if resp.status_code not in (codes.temporary_redirect, codes.permanent_redirect):
if 'Content-Length' in prepared_request.headers:
del prepared_request.headers['Content-Length']
+1 -1
View File
@@ -30,7 +30,7 @@ _codes = {
305: ('use_proxy',),
306: ('switch_proxy',),
307: ('temporary_redirect', 'temporary_moved', 'temporary'),
308: ('resume_incomplete', 'resume'),
308: ('permanent_redirect',),
# Client Error.
400: ('bad_request', 'bad'),