fix: support parameterized JSON content types - #2569
Closed
Karthik-Chowdary wants to merge 1 commit into
Closed
Conversation
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>
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. |
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.
Description
Parse MCP response media types instead of comparing the raw
Content-Typeheader. This recognizes valid parameterized and case-variedapplication/jsonvalues 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=1andmake 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.