From: Ian Cordasco Date: Fri, 8 Feb 2013 03:42:58 +0000 (-0500) Subject: We shouldn't be sending the data on redirect. X-Git-Tag: v1.2.0~48^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2ad0d0fe8f4bff1640417f67e7e321f030c1bed;p=services%2Fpython-requests.git We shouldn't be sending the data on redirect. As such, we should remove the body from the old request as well as the Content-Length header. --- diff --git a/requests/sessions.py b/requests/sessions.py index 8c1152c..7ee6221 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -121,10 +121,13 @@ class SessionRedirectMixin(object): # Remove the cookie headers that were sent. headers = prepared_request.headers - try: - del headers['Cookie'] - except KeyError: - pass + for h in ('Cookie', 'Content-Length'): + try: + del headers[h] + except KeyError: + pass + + prepared_request.body = None resp = self.send( prepared_request,