You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: unify JSON-RPC message validation policy across transports (#212)
The WebSocket and SSE receive paths validated messages with the strict
isJsonRpcMessage guard and silently dropped anything that failed it, so
a lenient peer's response (e.g. error:null alongside result) or request
(e.g. missing the jsonrpc field) never settled the caller's promise —
the same shapes worked over stdio, which only skips non-object lines.
Relax the per-transport guards (ws-stream, ws-server, sse, HTTP server
POST) to an object check and let the connection layer own the
accept/reject policy: it dispatches lenient requests, fast-rejects
structurally invalid responses with RequestError.invalidRequest, and
logs anything else, as of #210. Non-object payloads are still rejected
at the transport with a warning (or HTTP 400) since they carry no id to
answer. Also consolidates ws-stream's private isRecord duplicate.
Fixes#211
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
0 commit comments