mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
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:
committed by
Andreas Kling
parent
bc10729af6
commit
fb17f8ff66
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user