We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 734b799 commit d0c7410Copy full SHA for d0c7410
1 file changed
src/server/sse_server.cpp
@@ -511,6 +511,25 @@ bool SseServerWrapper::start()
511
return;
512
}
513
514
+ // Check if this is a notification (no "id" field means notification)
515
+ // JSON-RPC 2.0 spec: server MUST NOT reply to notifications
516
+ bool is_notification = !message.contains("id") || message["id"].is_null();
517
+
518
+ if (is_notification)
519
+ {
520
+ // For notifications, call handler but don't send response body
521
+ try
522
523
+ handler_(message); // Process but ignore result
524
+ }
525
+ catch (...)
526
527
+ // Silently ignore errors for notifications
528
529
+ res.status = 202; // Accepted, no content
530
+ return;
531
532
533
// Normal request - process with handler
534
auto response = handler_(message);
535
0 commit comments