AK+Everywhere: Remove the char const* JSON value constructor

This commit is contained in:
Timothy Flynn 2025-02-17 11:59:45 -05:00 committed by Tim Flynn
parent ee70f1327a
commit 70eb0ba1cd
Notes: github-actions[bot] 2025-02-21 00:29:35 +00:00
10 changed files with 35 additions and 35 deletions

View file

@ -236,6 +236,7 @@ static bool matches_platform_name(StringView requested_platform_name, StringView
static JsonValue match_capabilities(JsonObject const& capabilities, SessionFlags flags)
{
static auto browser_name = StringView { BROWSER_NAME, strlen(BROWSER_NAME) }.to_lowercase_string();
static constexpr auto browser_version = StringView { BROWSER_VERSION, __builtin_strlen(BROWSER_VERSION) };
static auto platform_name = StringView { OS_STRING, strlen(OS_STRING) }.to_lowercase_string();
// 1. Let matched capabilities be a JSON Object with the following entries:
@ -245,7 +246,7 @@ static JsonValue match_capabilities(JsonObject const& capabilities, SessionFlags
matched_capabilities.set("browserName"sv, browser_name);
// "browserVersion"
// The user agent version, as a string.
matched_capabilities.set("browserVersion"sv, BROWSER_VERSION);
matched_capabilities.set("browserVersion"sv, browser_version);
// "platformName"
// ASCII Lowercase name of the current platform as a string.
matched_capabilities.set("platformName"sv, platform_name);