cdp: ensure method action is present

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-10-09 12:40:17 +02:00
parent 0d89b98bad
commit eaf5c6f86f

View File

@@ -102,16 +102,17 @@ pub fn do(
return error.UnknonwDomain; return error.UnknonwDomain;
// select corresponding domain // select corresponding domain
const action = iter.next() orelse return error.BadMethod;
return switch (domain) { return switch (domain) {
.Browser => browser(alloc, id, iter.next().?, &scanner, ctx), .Browser => browser(alloc, id, action, &scanner, ctx),
.Target => target(alloc, id, iter.next().?, &scanner, ctx), .Target => target(alloc, id, action, &scanner, ctx),
.Page => page(alloc, id, iter.next().?, &scanner, ctx), .Page => page(alloc, id, action, &scanner, ctx),
.Log => log(alloc, id, iter.next().?, &scanner, ctx), .Log => log(alloc, id, action, &scanner, ctx),
.Runtime => runtime(alloc, id, iter.next().?, &scanner, s, ctx), .Runtime => runtime(alloc, id, action, &scanner, s, ctx),
.Network => network(alloc, id, iter.next().?, &scanner, ctx), .Network => network(alloc, id, action, &scanner, ctx),
.Emulation => emulation(alloc, id, iter.next().?, &scanner, ctx), .Emulation => emulation(alloc, id, action, &scanner, ctx),
.Fetch => fetch(alloc, id, iter.next().?, &scanner, ctx), .Fetch => fetch(alloc, id, action, &scanner, ctx),
.Performance => performance(alloc, id, iter.next().?, &scanner, ctx), .Performance => performance(alloc, id, action, &scanner, ctx),
}; };
} }