LibWeb: Get document for cookies usage from principal realm
Needed for when a shadow realm does an HTTP fetch as part of an import.
This commit is contained in:
parent
bc10729af6
commit
fb17f8ff66
Notes:
github-actions[bot]
2024-11-30 11:07:23 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/fb17f8ff66c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2631
1 changed files with 1 additions and 1 deletions
|
@ -1880,7 +1880,7 @@ WebIDL::ExceptionOr<GC::Ref<PendingResponse>> http_network_or_cache_fetch(JS::Re
|
|||
// with the user agent’s cookie store and httpRequest’s current URL.
|
||||
auto cookies = ([&] {
|
||||
// FIXME: Getting to the page client reliably is way too complicated, and going via the document won't work in workers.
|
||||
auto document = Bindings::principal_host_defined_environment_settings_object(realm).responsible_document();
|
||||
auto document = Bindings::principal_host_defined_environment_settings_object(HTML::principal_realm(realm)).responsible_document();
|
||||
if (!document)
|
||||
return String {};
|
||||
return document->page().client().page_did_request_cookie(http_request->current_url(), Cookie::Source::Http);
|
||||
|
|
Loading…
Add table
Reference in a new issue