Skip to content
Myr

Cleanup the redirect if blocks.

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

authored by Cory Benfield · committed by Cory Benfield · parent 470af31 · Browse files · 1 file+2 added−3 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+2 added−3 removed

  • other:+2 added−3 removed

1 file+2 added−3 removed

modified:requests/sessions.py+2 added-3 removed
111 unmodified lines
112 method = 'GET'113114 # Do what the browsers do, despite standards...115 # First, turn 302s into GETs.116 if (resp.status_code == codes.found and117 method not in ('GET', 'HEAD')):116 if resp.status_code == codes.found and method != 'HEAD':117 method = 'GET'118119 # Second, if a POST is responded to with a 301, turn it into a GET.120 # This bizarre behaviour is explained in Issue 1704.122 if (resp.status_code == codes.moved) and (method == 'POST'):121 if resp.status_code == codes.moved and method == 'POST':122 method = 'GET'123124 prepared_request.method = method125
412 unmodified lines