Finally resolve #1084
authorIan Cordasco <graffatcolmingov@gmail.com>
Thu, 28 Mar 2013 03:30:00 +0000 (23:30 -0400)
committerIan Cordasco <graffatcolmingov@gmail.com>
Thu, 28 Mar 2013 03:30:00 +0000 (23:30 -0400)
Send body on redirect when POSTing or PUTing.

requests/sessions.py

index ab56464..c306a8d 100644 (file)
@@ -134,7 +134,8 @@ class SessionRedirectMixin(object):
 
             prepared_request.method = method
 
-            if resp.status_code is not codes.temporary:
+            # https://github.com/kennethreitz/requests/issues/1084
+            if resp.status_code not in (codes.temporary, codes.resume):
                 if 'Content-Length' in prepared_request.headers:
                     del prepared_request.headers['Content-Length']