Consolidate logic for changing method during redirects
Before adoption: this commit came in with the history the project adopted, so no landing records it.
I only moved the code into a function, there was no actual change to the code. I added a few tests to ensure we're doing things correctly. The real point of me doing this is to make it easier to bring back `strict_mode` functionality. For you requests youngsters in the crowd, `strict_mode` followed the spec for redirects meaning the method wouldn't change to a GET. The current code follows the browser convention of changing the method to a GET when doing a 302 redirect. However, lots of servers want you to follow the standards (the nerve!) so I'd like to override the logic. Now that the method changing logic is in `rebuild_method`, I can simply override that function instead of overriding the entire `resolve_redirects` function as suggested by kennethreitz/requests#1325
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+66 added−17 removed
- tests:+43 added−0 removed
- other:+23 added−17 removed