mirror of
https://github.com/alibaba/higress.git
synced 2026-05-27 06:07:27 +08:00
opt: unify the end-of-line markers in the MCP session filter. (#2403)
This commit is contained in:
@@ -136,7 +136,7 @@ func (s *SSEServer) HandleSSE(cb api.FilterCallbackHandler, stopChan chan struct
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send the initial endpoint event
|
// 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)
|
err = s.redisClient.Publish(channel, initialEvent)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
api.LogErrorf("Failed to send initial event: %v", err)
|
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
|
var status int
|
||||||
// Only send response if there is one (not for notifications)
|
// Only send response if there is one (not for notifications)
|
||||||
if response != nil {
|
if response != nil {
|
||||||
if sessionID != ""{
|
if sessionID != "" {
|
||||||
w.WriteHeader(http.StatusAccepted)
|
w.WriteHeader(http.StatusAccepted)
|
||||||
status = http.StatusAccepted
|
status = http.StatusAccepted
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user