mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-06 11:12:54 +00:00
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.
This commit is contained in:
parent
7193e518d1
commit
c00760c5f9
Notes:
sideshowbarker
2024-07-18 20:22:16 +09:00
Author: https://github.com/trflynn89
Commit: c00760c5f9
Pull-request: https://github.com/SerenityOS/serenity/pull/6301
20 changed files with 54 additions and 47 deletions
|
@ -433,17 +433,17 @@ String InProcessWebView::page_did_request_prompt(const String& message, const St
|
|||
return {};
|
||||
}
|
||||
|
||||
String InProcessWebView::page_did_request_cookie(const URL& url)
|
||||
String InProcessWebView::page_did_request_cookie(const URL& url, Cookie::Source source)
|
||||
{
|
||||
if (on_get_cookie)
|
||||
return on_get_cookie(url);
|
||||
return on_get_cookie(url, source);
|
||||
return {};
|
||||
}
|
||||
|
||||
void InProcessWebView::page_did_set_cookie(const URL& url, const String& cookie)
|
||||
void InProcessWebView::page_did_set_cookie(const URL& url, const String& cookie, Cookie::Source source)
|
||||
{
|
||||
if (on_set_cookie)
|
||||
on_set_cookie(url, cookie);
|
||||
on_set_cookie(url, cookie, source);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue