Skip to content

fix(mcp): serialize message responses safely - #7115

Merged
Aias00 merged 3 commits into
apache:masterfrom
dengliming:fix-6748-mcp-message-json
Sep 21, 2026
Merged

Aias00 merged 3 commits into
apache:masterfrom
dengliming:fix-6748-mcp-message-json

Conversation

@dengliming

Copy link
Copy Markdown
Member

Summary

  • serialize SSE message responses with Jackson instead of string interpolation
  • emit UTF-8 JSON bytes without relying on the platform charset
  • reuse the mapper for JSON error responses and cover escaping/non-ASCII content

Testing

  • mvn -q -pl shenyu-plugin/shenyu-plugin-mcp-server -am -DskipTests=false -Dcheckstyle.skip=false -Dtest=McpServerPluginTest -DfailIfNoTests=false test

Fixes #6748

@Aias00 Aias00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved as PMC (Aias00). Reviewed the diff — small, well-scoped fix with regression tests; mergeable.

@Aias00
Aias00 merged commit 7683f56 into apache:master Sep 21, 2026
22 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.

[BUG] handleMessageEndpoint builds JSON via String.format without escaping + default-charset bytes

2 participants