Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle 1xx interim response codes #605

Merged
merged 3 commits into from Nov 17, 2022
Merged

Conversation

tomchristie
Copy link
Member

@tomchristie tomchristie commented Nov 17, 2022

This discussion on httpx indicates that the latest httpcore version has introduced a change in behaviour for "100 Continue" status codes.

This highlights that #581 has fixed our behaviour for "101 Switching Protocols" which is a final response code. But breaks our behaviour for "100 Continue", "102 Processing", and "103 Early Hints" statues codes, which are all interim response codes.

Our behaviour for now ought to treat any 1xx response codes as interim responses, with the exception of "101 Switching Protocols".

  • Tests for 100 and 103 status codes.
  • Fix behaviour for 100 and 103 status codes.

Note that in this PR I've only added tests for 100 and 103, since that's sufficient.

We could feasibly have additional smarts around how we deal with the interim cases. For example we could defer sending request bodies on "Expect: continue" requests, until we see a "100 continue". But that's really a different story.

@tomchristie tomchristie added the bug Something isn't working label Nov 17, 2022
@tomchristie tomchristie requested a review from a team November 17, 2022 12:26
Copy link
Sponsor Member

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! 👍

@tomchristie tomchristie merged commit c03eea0 into master Nov 17, 2022
@tomchristie tomchristie deleted the handle-1xx-interim-responses branch November 17, 2022 12:59
@tomchristie tomchristie mentioned this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants