Repository navigation
Conversation
The handler is documented to follow redirects for all HTTP methods and to repeat the original request, method and data included. It only did that for 301, 302 and 303 on POST and PUT, so a 307 or 308, the statuses that exist to keep the method, raised HTTPError, and so did every redirect of a DELETE. Signed-off-by: Christopher Krah <48338417+chrikrah@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
passthrough_redirect_handleris documented to follow redirects for all HTTP methods, and its docstring says "any request method". It repeats the request, method and data included, but only for 301, 302 and 303 on POST and PUT. A 307 or 308 raisesHTTPError, and any redirect of a DELETE does too.The check copies the urllib rule that #622 added the handler to get around ("for all method types"). An nginx
return 307in front of a pushgateway sends a 307. Before Python 3.11 urllib never routes a 308 here, so the class setshttp_error_308itself.No issue exists for this. @csmarchbanks, DELETE now follows on 301 to 303 too, because the docs say all methods. Want it narrowed to 307 and 308?