-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refine how redirect method is set (#829)
Fixes #825. TIL: not all redirects should use the same method as the original request, and in fact, most http client implementations will default the new request method to GET. I included links to a few useful discussions/references, but essentially the behavior we now support is: * For 307/308 response status, use original request method; these statuses are specifically for indicating the original method is ok * For 303 response status, must use GET method * For other 3xx responses, it's actually legal to use the original method, but most client implementations will switch to GET, which means most servers have adapted to expect this and may even error if the original request method is used (as is the case in the originally reported issue). We now follow this behavior, though, like curl, allow overriding this behavior by a new `redirect_method` keyword arg to allow specifying the redirect method behavior.
- Loading branch information
Showing
3 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters