Skip to content

Commit

Permalink
🚑 Fix empty messages on sse bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
wesen committed Feb 11, 2025
1 parent 41bc93e commit 23ff5cd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/server/transports/stdio/sse_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ func (s *SSEBridgeServer) handleMessage(message string) error {
return s.sendError(&request.ID, -32603, "Internal error", err)
}

if response == nil {
s.logger.Debug().Msg("No response from SSE server")
return nil
}

jsonResponse, _ := json.MarshalIndent(response, "", " ")
s.logger.Debug().RawJSON("response", jsonResponse).Msg("Forwarded request to SSE server")

// Send the response back over stdio
return s.writer.Encode(response)
}
Expand Down

0 comments on commit 23ff5cd

Please sign in to comment.