1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 20:27:46 +00:00

LibWeb: Port ParsedCookie from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-11-22 08:36:23 +13:00 committed by Tim Flynn
parent f43313d099
commit 1b05598cd3
4 changed files with 21 additions and 20 deletions

View file

@ -1570,21 +1570,21 @@ Messages::WebDriverClient::AddCookieResponse WebDriverConnection::add_cookie(Jso
// 7. Create a cookie in the cookie store associated with the active documents address using cookie name name, cookie value value, and an attribute-value list of the following cookie concepts listed in the table for cookie conversion from data:
Web::Cookie::ParsedCookie cookie {};
cookie.name = TRY(get_property(data, "name"sv));
cookie.value = TRY(get_property(data, "value"sv));
cookie.name = MUST(String::from_deprecated_string(TRY(get_property(data, "name"sv))));
cookie.value = MUST(String::from_deprecated_string(TRY(get_property(data, "value"sv))));
// Cookie path
// The value if the entry exists, otherwise "/".
if (data.has("path"sv))
cookie.path = TRY(get_property(data, "path"sv));
cookie.path = MUST(String::from_deprecated_string(TRY(get_property(data, "path"sv))));
else
cookie.path = "/";
cookie.path = "/"_string;
// Cookie domain
// The value if the entry exists, otherwise the current browsing contexts active documents URL domain.
// NOTE: The otherwise case is handled by the CookieJar
if (data.has("domain"sv))
cookie.domain = TRY(get_property(data, "domain"sv));
cookie.domain = MUST(String::from_deprecated_string(TRY(get_property(data, "domain"sv))));
// Cookie secure only
// The value if the entry exists, otherwise false.