mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user