fix: use fixed Lightpanda/1.0 for /json/version User-Agent

Replace dynamic build version string with stable Lightpanda/1.0
in the Browser and User-Agent fields of the /json/version response.
The dev version (1.0.0-dev.5492+...) is not useful for CDP clients.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt Van HornandClaude Opus 4.6 authored and Pierre Tachoire committed 2026-04-10 17:36:10 +02:00
1 parent 416984d32f
commit 224a7333f2
1 file changed
+4 -5
+4 -5
View File
@@ -494,15 +494,14 @@ fn buildJSONVersionResponse(
.message = "when --host is set to 0.0.0.0 consider setting --advertise-host to a reachable address",
});
}
const version = lp.build_config.version;
const body_format =
"{{" ++
"\"Browser\": \"Lightpanda/{s}\", " ++
"\"Browser\": \"Lightpanda/1.0\", " ++
"\"Protocol-Version\": \"1.3\", " ++
"\"User-Agent\": \"Lightpanda/{s}\", " ++
"\"User-Agent\": \"Lightpanda/1.0\", " ++
"\"webSocketDebuggerUrl\": \"ws://{s}:{d}/\"" ++
"}}";
const body_len = std.fmt.count(body_format, .{ version, version, host, port });
const body_len = std.fmt.count(body_format, .{ host, port });
// We send a Connection: Close (and actually close the connection)
// because chromedp (Go driver) sends a request to /json/version and then
@@ -516,7 +515,7 @@ fn buildJSONVersionResponse(
"Connection: Close\r\n" ++
"Content-Type: application/json; charset=UTF-8\r\n\r\n" ++
body_format;
return try std.fmt.allocPrint(app.allocator, response_format, .{ body_len, version, version, host, port });
return try std.fmt.allocPrint(app.allocator, response_format, .{ body_len, host, port });
}
const empty_json_list_response =