mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 04:27:12 +02:00
LibWeb: Implement the document.cookie setter/getter according to spec
This ensures we cannot set or get cookies on non-HTTP(S) origins. Since this would prevent our ability to test cookies during LibWeb tests, this also adds an internals API to allow cookie access on file:// URLs.
This commit is contained in:
committed by
Andreas Kling
parent
86744449e3
commit
527218da19
Notes:
github-actions[bot]
2024-10-23 07:06:33 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/527218da19d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1926
@@ -12,6 +12,11 @@
|
||||
document.cookie = `${name}=""; max-age=-9999`;
|
||||
};
|
||||
|
||||
const cookieAverseTest = () => {
|
||||
document.cookie = "cookie=value";
|
||||
printCookies("Cookie averse test");
|
||||
};
|
||||
|
||||
const basicTest = () => {
|
||||
document.cookie = "cookie=value";
|
||||
printCookies("Basic test");
|
||||
@@ -178,6 +183,10 @@
|
||||
};
|
||||
|
||||
test(() => {
|
||||
cookieAverseTest();
|
||||
|
||||
internals.enableCookiesOnFileDomains();
|
||||
|
||||
basicTest();
|
||||
multipleCookiesTest();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user