Repository navigation
Commit 18c1cf6
committed
Fix: Add UTF-8 charset to Content-Type header for Chinese tool names
When calling tools with Chinese names using HttpClientSseClientTransport
or HttpClientStreamableHttpTransport, the JSON body was sent without
explicit charset encoding. This caused Chinese characters to be corrupted
on the server side because the default encoding wasn't UTF-8.
This fix adds '; charset=UTF-8' to the Content-Type header in both transport
classes, ensuring proper encoding of non-ASCII characters.
Fixes modelcontextprotocol#2601 parent 5e77762 commit 18c1cf6
2 files changed
Lines changed: 2 additions & 2 deletions
File tree
- mcp-core/src/main/java/io/modelcontextprotocol/client/transport
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
| 448 | + | |
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | | - | |
| 480 | + | |
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
| |||
0 commit comments