projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3299771
)
We shouldn't be sending the data on redirect.
author
Ian Cordasco
<graffatcolmingov@gmail.com>
Fri, 8 Feb 2013 03:42:58 +0000
(22:42 -0500)
committer
Ian Cordasco
<graffatcolmingov@gmail.com>
Sun, 10 Feb 2013 22:11:16 +0000
(17:11 -0500)
As such, we should remove the body from the old request as well as the
Content-Length header.
requests/sessions.py
patch
|
blob
|
history
diff --git
a/requests/sessions.py
b/requests/sessions.py
index
8c1152c
..
7ee6221
100644
(file)
--- 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,