Repository navigation
fix(http1): avoid adding close to switching protocols responses - #4248
Merged
seanmonstar merged 1 commit intoNov 17, 2026
Merged
Conversation
Do not append Connection: close to an HTTP/1.1 101 response when HTTP keep-alive is disabled The connection is handed off to the upgraded protocol rather than closed Extend the existing upgrade test to cover a request with Connection: close, Upgrade Verify the response headers while retaining the buffered-byte and upgraded-I/O checks Fixes hyperium#4244
Member
|
Thanks for offering to fix a bunch of things, I do appreciate it! I notice you check the box that it was not written by an LLM, but it does look it was. Your profile mentions you use it because of poor English. Can I ask a change? We don't mind if your English isn't perfect. That's totally fine! But we want to hear you. If you really hate your English writing, you can write out the sentences in Japanese, and then ask an LLM only to directly translate. The problem is that when they are asked to generate a larger write-up, they do a poor robot job. But, your attempt at English is also welcome! |
seanmonstar
approved these changes
Nov 17, 2026
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.
Fixes 4244
I fixed it so that Connection close is not attached to the 101 Switching
Protocols response when keep alive is disabled Because when it is 101, rather
than closing it in HTTP, we have to pass the connection as is to the protocol
being upgraded to
Added is_switching_protocols to Http1Transaction, and modified it so that it
does not put the close header when it is 101, the close processing for a normal
final response remains as is Added the Connection close, Upgrade case to the
upgrades_new test, and confirmed that close is not attached
Locally, I have also already confirmed cargo test features full and clippy, and
that ping pong passes with the reproduction code from the Issue
The description, docs, and comments words meant for humans are written by a
human, not by an LLM