Skip to content
Myr

upload data on redirects too

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

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

  • other:+5 added−0 removed

1 file+5 added−0 removed

modified:requests/models.py+5 added
229 unmodified lines
230231 history.append(r)232233 url = r.headers['location']234 data = self.data235236 # Handle redirection without scheme (see: RFC 1808 Section 4)237 if url.startswith('//'):238 parsed_rurl = urlparse(r.url)
9 unmodified lines
248249 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4250 if r.status_code is codes.see_other:251 method = 'GET'252 data = None253 else:254 method = self.method255256 # Do what the browsers do if strict_mode is off...257 if (not self.config.get('strict_mode')):258259 if r.status_code in (codes.moved, codes.found) and self.method == 'POST':260 method = 'GET'261 data = None262263 if (r.status_code == 303) and self.method != 'HEAD':264 method = 'GET'265 data = None266267 # Remove the cookie headers that were sent.268 headers = self.headers269 try:
9 unmodified lines
279 params=self.session.params,280 auth=self.auth,281 cookies=self.cookies,282 redirect=True,283 data=data,284 config=self.config,285 timeout=self.timeout,286 _poolmanager=self._poolmanager,287 proxies=self.proxies,
530 unmodified lines