Skip to content
Myr

Fix POST 303 redirect resonse handling

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

This fixes issue #1156.

authored by Yehuda Sadeh · committed by Yehuda Sadeh · parent 113b67c · Browse files · 1 file+1 added−1 removed
This commit

State

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

Trailers

  • Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:requests/sessions.py+1 added-1 removed
104 unmodified lines
105 # Compliant with RFC3986, we percent encode the url.106 url = urljoin(resp.url, requote_uri(url))107108 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4109 if resp.status_code is codes.see_other and req.method != 'HEAD':109 if resp.status_code == codes.see_other and req.method != 'HEAD':110 method = 'GET'111112 # Do what the browsers do, despite standards...113 if resp.status_code in (codes.moved, codes.found) and req.method == 'POST':
296 unmodified lines