diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-04-13 17:30:41 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-14 16:07:46 +0200 |
commit | c00760c5f9ca72b89b39feb7042978da2f15eef3 (patch) | |
tree | fcec9f5b592b3472593c4f136c90e2f5595eac67 /Userland/Libraries/LibWeb/WebContentClient.cpp | |
parent | 7193e518d1190e54ba3a94cc42c4905a7be786a1 (diff) | |
download | serenity-c00760c5f9ca72b89b39feb7042978da2f15eef3.zip |
Browser+LibWeb+WebContent: Track the source of document.cookie requests
To implement the HttpOnly attribute, the CookieJar needs to know where a
request originated from. Namely, it needs to distinguish between HTTP /
non-HTTP (i.e. JavaScript) requests. When the HttpOnly attribute is set,
requests from JavaScript are to be blocked.
Diffstat (limited to 'Userland/Libraries/LibWeb/WebContentClient.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/WebContentClient.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/WebContentClient.cpp b/Userland/Libraries/LibWeb/WebContentClient.cpp index d7e95be831..dd25e07e3a 100644 --- a/Userland/Libraries/LibWeb/WebContentClient.cpp +++ b/Userland/Libraries/LibWeb/WebContentClient.cpp @@ -199,13 +199,13 @@ void WebContentClient::handle(const Messages::WebContentClient::DidChangeFavicon OwnPtr<Messages::WebContentClient::DidRequestCookieResponse> WebContentClient::handle(const Messages::WebContentClient::DidRequestCookie& message) { - auto result = m_view.notify_server_did_request_cookie({}, message.url()); + auto result = m_view.notify_server_did_request_cookie({}, message.url(), static_cast<Cookie::Source>(message.source())); return make<Messages::WebContentClient::DidRequestCookieResponse>(result); } void WebContentClient::handle(const Messages::WebContentClient::DidSetCookie& message) { - m_view.notify_server_did_set_cookie({}, message.url(), message.cookie()); + m_view.notify_server_did_set_cookie({}, message.url(), message.cookie(), static_cast<Cookie::Source>(message.source())); } } |