Skip to content

Close bodyless h2c request streams - #196

Merged
HoneyryderChuck merged 1 commit into
igrigorik:mainfrom
OskarEichler:audit/fix-bodyless-h2c-end-stream
Sep 9, 2026
Merged

Close bodyless h2c request streams#196
HoneyryderChuck merged 1 commit into
igrigorik:mainfrom
OskarEichler:audit/fix-bodyless-h2c-end-stream

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary

  • set END_STREAM on the synthesized request HEADERS for a bodyless h2c upgrade
  • preserve END_HEADERS, which is already present on the frame
  • leave request bodies on the existing DATA + END_STREAM path

Reproduction

Server#upgrade initializes the frame with END_HEADERS, then ORs END_HEADERS a second time when the HTTP/1.1 request body is empty. Stream 1 remains open, although RFC 9113's h2c upgrade semantics require the completed HTTP/1.1 request to be half-closed from the client toward the server.

Verification

  • 448 examples, 0 failures on Ruby 4.0.6
  • focused bodyless upgrade finishes in half_closed_remote
  • body-bearing upgrade behavior remains covered by the existing suite
  • syntax and RuboCop pass

No repository tests were changed. I used an AI coding assistant during investigation and verification.

@HoneyryderChuck

Copy link
Copy Markdown
Collaborator

thx @OskarEichler this definitely looks like a blunder 🙏

@HoneyryderChuck
HoneyryderChuck merged commit 04e62f4 into igrigorik:main Sep 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants