Skip to content

fix: support parameterized JSON content types - #2569

Closed
Karthik-Chowdary wants to merge 1 commit into
envoyproxy:mainfrom
Karthik-Chowdary:fix-mcp-json-content-type-2568
Closed

fix: support parameterized JSON content types#2569
Karthik-Chowdary wants to merge 1 commit into
envoyproxy:mainfrom
Karthik-Chowdary:fix-mcp-json-content-type-2568

Conversation

@Karthik-Chowdary

@Karthik-Chowdary Karthik-Chowdary commented Aug 21, 2026

Copy link
Copy Markdown

Description

Parse MCP response media types instead of comparing the raw Content-Type header. This recognizes valid parameterized and case-varied application/json values across all MCP proxy response paths, rejects malformed media types, and preserves non-JSON/SSE handling.

Tests cover plain, parameterized, case-varied, malformed, missing, and SSE media types. Local verification passed with go test ./internal/mcpproxy -count=1 and make precommit.

Related Issues/PRs (if applicable)

Fixes #2568

Special notes for reviewers (if applicable)

Hermes Agent was used to help investigate the issue, draft the implementation and tests, and review the change. I reviewed and understand the submitted code and take responsibility for it.

Recognize valid application/json Content-Type values with parameters across all MCP response paths. Reject malformed media types and cover plain, parameterized, case-variant, missing, malformed, and SSE values.

Fixes envoyproxy#2568

AI assistance: Hermes Agent helped investigate, implement, and test this change; the contributor reviewed and takes responsibility for it.

Signed-off-by: Karthik Chowdary <21139050+Karthik-Chowdary@users.noreply.github.com>
@Karthik-Chowdary
Karthik-Chowdary requested a review from a team as a code owner August 21, 2026 10:06
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 21, 2026
@Karthik-Chowdary

Copy link
Copy Markdown
Author

Closing in favor of the earlier #2306, which already implements parameter-aware JSON media-type handling across these MCP proxy paths. I missed that existing PR during the duplication check—apologies for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP proxy silently drops backend JSON responses when Content-Type carries a charset parameter (exact string match in session.go)

1 participant