From 224a7333f2bfb9ad9bb58cfde00dd028c38a1edd Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Fri, 10 Apr 2026 07:52:03 -0700 Subject: [PATCH] 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) --- src/Server.zig | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Server.zig b/src/Server.zig index 68e3a53f8..e3edda06a 100644 --- a/src/Server.zig +++ b/src/Server.zig @@ -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 =