Skip to content
Myr

POST redirect => GET

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

#269

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

  • other:+10 added−0 removed

1 file+10 added−0 removed

modified:requests/models.py+10 added
214 unmodified lines
215216 self.cookies.update(r.cookies)217218 if r.status_code in REDIRECT_STATI and not self.redirect:219220 while (('location' in r.headers) and221 ((r.status_code is codes.see_other) or (self.allow_redirects))):222223 r.content # Consume socket so it can be released
26 unmodified lines
250 method = 'GET'251 else:252 method = self.method253254 # Do what the browsers do if strict_mode is off...255 if (not self.config.get('strict_mode')):256257 if r.status_code in (codes.moved, codes.found) and self.method == 'POST':258 method = 'GET'259260 if (r.status_code == 303) and self.method != 'HEAD':261 method = 'GET'262263 # Remove the cookie headers that were sent.264 headers = self.headers265 try:266 del headers['Cookie']
546 unmodified lines