Skip to content
Myr

Change the method when it isn't already GET/HEAD

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

For some reason it was only change the method when a POST was being made. This is almost certainly my fault. Fixes #1303

authored by Ian Cordasco · committed by Ian Cordasco · parent eda4b55 · 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.

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
123 unmodified lines
124 method = 'GET'125126 # Do what the browsers do, despite standards...127 if (resp.status_code in (codes.moved, codes.found) and128 prepared_request.method == 'POST'):128 prepared_request.method not in ('GET', 'HEAD')):129 method = 'GET'130131 prepared_request.method = method132
373 unmodified lines