rename resume/resume_incomplete to permanent_redirect according to rfc7238
authorEric L Frederich <eric.frederich@siemens.com>
Wed, 11 Jun 2014 15:08:10 +0000 (11:08 -0400)
committerEric L Frederich <eric.frederich@siemens.com>
Wed, 11 Jun 2014 15:08:10 +0000 (11:08 -0400)
Use temporary_redirect intead of temporary_moved to make the words
line up nicely ;-)

requests/models.py
requests/sessions.py
requests/status_codes.py

index 7bcebfdcb1749036d7f0e99fa4ac6a149c610e6d..b43901b7dbd7ab0027be7463823d37e0c94fbd35 100644 (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
index 4ec3d14f99ed4105c5b6201b229f5b00a1f09727..5827d9176bcfc978e1e002ef34934b21ef95279a 100644 (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']
 
index ed7a8660a6f6085861ba3fea10a50487dfb5d351..9a431dd608beefc6783abe8be62b03c750db2891 100644 (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'),