From 087cb48fc5fd687c6a6a3fe0b6730226e343c7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BE=84=E6=BD=AD?= Date: Thu, 12 Jun 2025 18:58:56 +0800 Subject: [PATCH] opt: unify the `end-of-line` markers in the MCP session filter. (#2403) --- plugins/golang-filter/mcp-session/common/sse.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/golang-filter/mcp-session/common/sse.go b/plugins/golang-filter/mcp-session/common/sse.go index 11fee2458..b22e8f45b 100644 --- a/plugins/golang-filter/mcp-session/common/sse.go +++ b/plugins/golang-filter/mcp-session/common/sse.go @@ -136,7 +136,7 @@ func (s *SSEServer) HandleSSE(cb api.FilterCallbackHandler, stopChan chan struct } // Send the initial endpoint event - initialEvent := fmt.Sprintf("event: endpoint\ndata: %s\r\n\r\n", messageEndpoint) + initialEvent := fmt.Sprintf("event: endpoint\ndata: %s\n\n", messageEndpoint) err = s.redisClient.Publish(channel, initialEvent) if err != nil { api.LogErrorf("Failed to send initial event: %v", err) @@ -210,7 +210,7 @@ func (s *SSEServer) HandleMessage(w http.ResponseWriter, r *http.Request, body j var status int // Only send response if there is one (not for notifications) if response != nil { - if sessionID != ""{ + if sessionID != "" { w.WriteHeader(http.StatusAccepted) status = http.StatusAccepted } else {