From fb17f8ff66c140940c0f47f9686bdcb143243743 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Thu, 28 Nov 2024 03:05:11 +1300 Subject: [PATCH] LibWeb: Get document for cookies usage from principal realm Needed for when a shadow realm does an HTTP fetch as part of an import. --- Libraries/LibWeb/Fetch/Fetching/Fetching.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp b/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp index ce2fae059ed..ea23873ee81 100644 --- a/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp +++ b/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp @@ -1880,7 +1880,7 @@ WebIDL::ExceptionOr> 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);