Skip to content
Myr

We shouldn't be sending the data on redirect.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

As such, we should remove the body from the old request as well as the Content-Length header.

authored by Ian Cordasco · committed by Ian Cordasco · parent 3299771 · Browse files · 1 file+7 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−4 removed

  • other:+7 added−4 removed

1 file+7 added−4 removed

modified:requests/sessions.py+7 added-4 removed
119 unmodified lines
120 prepared_request.method = method121122 # Remove the cookie headers that were sent.123 headers = prepared_request.headers124 for h in ('Cookie', 'Content-Length'):124 try:125 del headers['Cookie']126 except KeyError:127 pass125 try:126 del headers[h]127 except KeyError:128 pass129130 prepared_request.body = None131132 resp = self.send(133 prepared_request,134 stream=stream,135 timeout=timeout,
313 unmodified lines