mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-04-02 02:16:44 +00:00
mcp: handle missing request IDs safely
This commit is contained in:
@@ -80,6 +80,7 @@ pub fn handleMessage(server: *Server, arena: std.mem.Allocator, msg: []const u8)
|
||||
}
|
||||
|
||||
fn handleInitialize(server: *Server, req: protocol.Request) !void {
|
||||
const id = req.id orelse return;
|
||||
const result = protocol.InitializeResult{
|
||||
.protocolVersion = "2025-11-25",
|
||||
.capabilities = .{
|
||||
@@ -92,7 +93,7 @@ fn handleInitialize(server: *Server, req: protocol.Request) !void {
|
||||
},
|
||||
};
|
||||
|
||||
try server.sendResult(req.id.?, result);
|
||||
try server.sendResult(id, result);
|
||||
}
|
||||
|
||||
fn handlePing(server: *Server, req: protocol.Request) !void {
|
||||
|
||||
Reference in New Issue
Block a user