Skip to content
Myr

redirects clear files also

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

Fixes #575

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 2a7811b · Browse files · 1 file+5 added−1 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+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:requests/models.py+5 added-1 removed
234 unmodified lines
235 history.append(r)236237 url = r.headers['location']238 data = self.data239 files = self.files240241 # Handle redirection without scheme (see: RFC 1808 Section 4)242 if url.startswith('//'):243 parsed_rurl = urlparse(r.url)
10 unmodified lines
254 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4255 if r.status_code is codes.see_other:256 method = 'GET'257 data = None258 files = None259 else:260 method = self.method261262 # Do what the browsers do if strict_mode is off...
1 unmodified line
264265 if r.status_code in (codes.moved, codes.found) and self.method == 'POST':266 method = 'GET'267 data = None268 files = None269270 if (r.status_code == 303) and self.method != 'HEAD':271 method = 'GET'272 data = None273 files = None274275 # Remove the cookie headers that were sent.276 headers = self.headers277 try:
3 unmodified lines
281282 request = Request(283 url=url,284 headers=headers,281 files=self.files,285 files=files,286 method=method,287 params=self.session.params,288 auth=self.auth,289 cookies=self.cookies,
557 unmodified lines