This change updates the MCP client stdio JSON decoder to correctly handle both Unix (`\n`) and Windows (`\r\n`) line endings. Fixes #664 Co-authored-by: qysz <i_zf@qq.com>
This commit is contained in:
parent
2ce44d45e9
commit
1bec3c60a0
1 changed files with 7 additions and 1 deletions
|
|
@ -83,6 +83,11 @@ func TestIOConnRead(t *testing.T) {
|
|||
want: "",
|
||||
protocolVersion: "",
|
||||
},
|
||||
{
|
||||
name: "windows newline at the end of first valid json input",
|
||||
input: "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"test\",\"params\":{}}\r\n",
|
||||
want: "",
|
||||
},
|
||||
{
|
||||
name: "batching old protocol",
|
||||
input: `[{"jsonrpc":"2.0","id":1,"method":"test1"},{"jsonrpc":"2.0","id":2,"method":"test2"}]`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue