Repository navigation
fix(mitm): keep HTTP/2 framing that ends on HEADERS - #111
Open
AuceptinFang wants to merge 2 commits into
Open
AuceptinFang wants to merge 2 commits into
AuceptinFang wants to merge 2 commits into
Conversation
The HTTP/2 relay always opened the upstream request without END_STREAM
and closed it with an empty DATA frame, so a GET the client ended on
HEADERS reached the origin as a request with an (empty) body. claude.ai
answers such requests to /edge-api/bootstrap/{org}/app_start with 500,
which breaks Claude Desktop once its traffic goes through the broker.
Sample whether the client ended the request on HEADERS before the body
is consumed, and forward the head with END_STREAM in that case unless
inspection produced a body to send.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The response half had the same framing bug as requests: the relay sent the response head without END_STREAM and closed with an empty DATA frame. For a 304 that carries the representation's Content-Length, the trailing DATA frame makes the response malformed and h2 clients reset the stream with PROTOCOL_ERROR. Forward the response head with END_STREAM when the origin ended the response on HEADERS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SKTT1Ryze
force-pushed
the
fix/h2-bodiless-end-stream
branch
from
November 25, 2026 03:41
f8c8a6b to
a5fcbff
Compare
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.
Problem
The HTTP/2 relay always opened the forwarded stream without END_STREAM and closed it afterwards with an empty DATA frame, in both directions.
GET /edge-api/bootstrap/{org}/app_startwith500, and Claude Desktop then reports "Service temporarily unreachable" as soon as its claude.ai traffic is decrypted by the broker.304that keeps the representation'sContent-Length, that frame makes the response malformed, and h2 clients reset the stream withPROTOCOL_ERROR.Change
Each side now forwards the peer's own framing. The relay samples whether the client ended the request on HEADERS before the body is consumed and opens the upstream stream with END_STREAM in that case. The one exception is a body that request inspection adds to a bodiless request, which is still sent. The response head is likewise forwarded with END_STREAM when the origin ended the response on HEADERS. The request and response halves are separate commits.