fix: handle trailing slash on /json/version CDP endpoint

Some CDP clients (e.g. playwright-go) request /json/version/ with a
trailing
slash. Added handling for this variant to match the exact same behavior
as /json/version
This commit is contained in:
ireydiak
2026-02-24 22:23:11 -05:00
parent 4017911373
commit d3bb0b6ff0

View File

@@ -521,7 +521,7 @@ pub const Client = struct {
return true; return true;
} }
if (std.mem.eql(u8, url, "/json/version")) { if (std.mem.eql(u8, url, "/json/version") or std.mem.eql(u8, url, "/json/version/")) {
try self.send(self.json_version_response); try self.send(self.json_version_response);
// Chromedp (a Go driver) does an http request to /json/version // Chromedp (a Go driver) does an http request to /json/version
// then to / (websocket upgrade) using a different connection. // then to / (websocket upgrade) using a different connection.