Change the method when it isn't already GET/HEAD
authorIan Cordasco <graffatcolmingov@gmail.com>
Sat, 13 Apr 2013 16:30:05 +0000 (12:30 -0400)
committerIan Cordasco <graffatcolmingov@gmail.com>
Sat, 13 Apr 2013 16:31:22 +0000 (12:31 -0400)
For some reason it was only change the method when a POST was being made. This
is almost certainly my fault.

Fixes #1303

requests/sessions.py

index eb6b1eb61630012244557fa539d76bd9cc85f1ac..27ca18fc49c7b1481c47fbb21f1dddfeccd88824 100644 (file)
@@ -125,7 +125,7 @@ class SessionRedirectMixin(object):
 
             # Do what the browsers do, despite standards...
             if (resp.status_code in (codes.moved, codes.found) and
-                    prepared_request.method == 'POST'):
+                    prepared_request.method not in ('GET', 'HEAD')):
                 method = 'GET'
 
             prepared_request.method = method