cdp: ensure there is an ID on each request

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-10-15 17:28:18 +02:00
parent 7750956c7b
commit 84c49fbe34
10 changed files with 100 additions and 94 deletions

View File

@@ -46,11 +46,11 @@ pub fn log(
fn enable(
alloc: std.mem.Allocator,
id: ?u16,
_id: ?u16,
scanner: *std.json.Scanner,
_: *Ctx,
) ![]const u8 {
const msg = try getMsg(alloc, void, scanner);
const msg = try getMsg(alloc, _id, void, scanner);
return result(alloc, id orelse msg.id.?, null, null, msg.sessionID);
return result(alloc, msg.id, null, null, msg.sessionID);
}