Repository navigation
fix(mcp): cap legacy SSE line length - #559
Merged
Merged
Conversation
The legacy SSE reader used ReadString, so one event with no newline was buffered without a limit. Stop a line that grows past the existing JSON-RPC buffer cap in both the endpoint announcement and the event loop.
Contributor
|
Review notes Looks good to merge. Nit: the 8 MiB cap counts the whole line, including |
BaaRai
force-pushed
the
fix/mcp-sse-line
branch
from
November 26, 2026 22:25
7be67bf to
05bd9b2
Compare
BaaRai
force-pushed
the
fix/mcp-sse-line
branch
from
November 26, 2026 22:40
05bd9b2 to
6c9ae4f
Compare
BaaRai
force-pushed
the
fix/mcp-sse-line
branch
from
November 26, 2026 22:56
6c9ae4f to
68841af
Compare
BaaRai
force-pushed
the
fix/mcp-sse-line
branch
from
November 26, 2026 23:14
68841af to
7c7dcc5
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.
The legacy SSE client read each event with
ReadString. One event that never sent a newline was buffered with no limit. The JSON-RPC body and the assembled SSE payload already stop at 8 MiB.The endpoint announcement and the event loop now use the same cap per line. A longer line is an error and both readers stop. Short same-origin endpoint lines are unchanged.
go test -count=1 ./mcphttp/passed.