Don't conflate request and response IDs in Streamable HTTP transports (#475)

This commit is contained in:
Stephen Halter 2025-06-03 12:17:11 -07:00 • committed by GitHub
commit 046903c27b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,7 +60,7 @@ internal sealed class StreamableHttpPostTransport(StreamableHttpServerTransport
{
yield return message;
if (message.Data is JsonRpcMessageWithId response && response.Id == _pendingRequest)
if (message.Data is JsonRpcResponse or JsonRpcError && ((JsonRpcMessageWithId)message.Data).Id == _pendingRequest)
{
// Complete the SSE response stream now that all pending requests have been processed.
break;