Repository navigation
Conversation
HTTPResponse.begin() only skipped "100 Continue", so any other 1xx response, such as "102 Processing" or "103 Early Hints", was returned as the final response and the real response was left unread on the connection. RFC 9110 requires clients to parse 1xx responses received before the final response, and allows them to ignore unexpected ones. Skip every 1xx response except "101 Switching Protocols", which is still returned to the caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
This is a breaking change which was not discussed for a long time. We should first revive the discussion to decide how not to break consumers. Even if we do devite from the RFC, this may be nontrivial. |
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.
HTTPResponse.begin()only skips100 Continue. Any other 1xx response (102 Processing,103 Early Hints, ...) is returned as the final response, and the real response stays unread on the connection. With urllib it shows up as an error when a server sends103 Early Hintsbefore200 OK:RFC 9110 (section 15.2) says a client must be able to parse 1xx responses that arrive before the final response, and may ignore unexpected ones. This skips every 1xx response the same way
100 Continueis skipped, except101 Switching Protocols, which is still returned to the caller, as suggested in the issue.test_httpservers.test_send_errorchecked a102response fromhttp.serverthroughhttp.client, which can no longer see it, so that case moved to a new test that reads the raw response from the socket.I used Claude Code to write this change.