File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -511,22 +511,19 @@ bool SseServerWrapper::start()
511511 return ;
512512 }
513513
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-
514+ // JSON-RPC notifications (missing/null id) must not receive responses.
515+ const bool is_notification = !message.contains (" id" ) || message[" id" ].is_null ();
518516 if (is_notification)
519517 {
520- // For notifications, call handler but don't send response body
521518 try
522519 {
523- handler_ (message); // Process but ignore result
520+ ( void ) handler_ (message); // process side effects only
524521 }
525522 catch (...)
526523 {
527- // Silently ignore errors for notifications
524+ // Ignore notification errors by design.
528525 }
529- res.status = 202 ; // Accepted, no content
526+ res.status = 202 ;
530527 return ;
531528 }
532529
You can’t perform that action at this time.
0 commit comments