1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:28:13 +00:00

Browser+WebContent+WebDriver: Move Add Cookie to WebContent

The new implementation is made a bit simpler by way of TRY. It also
implements setting the SameSite attribute.
This commit is contained in:
Timothy Flynn 2022-11-11 11:00:45 -05:00 committed by Linus Groh
parent fce9fcf154
commit 18abc6c85d
9 changed files with 86 additions and 137 deletions

View file

@ -771,8 +771,7 @@ Web::WebDriver::Response Client::handle_add_cookie(Vector<StringView> const& par
{
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/cookie");
auto* session = TRY(find_session_with_id(parameters[0]));
auto result = TRY(session->add_cookie(payload));
return make_json_value(result);
return session->web_content_connection().add_cookie(payload);
}
// 14.4 Delete Cookie, https://w3c.github.io/webdriver/#dfn-delete-cookie