Bug 1432272 - Make Fetch API use the global's base URL instead of the entry document's base URL

This commit is contained in:
FranklinDM 2023-03-11 12:44:46 +08:00 committed by roytam1
commit 62e2fbc4e9
2 changed files with 6 additions and 3 deletions

View file

@ -65,7 +65,8 @@ Response::Redirect(const GlobalObject& aGlobal, const nsAString& aUrl,
if (NS_IsMainThread()) {
nsCOMPtr<nsIURI> baseURI;
nsIDocument* doc = GetEntryDocument();
nsCOMPtr<nsPIDOMWindowInner> inner(do_QueryInterface(aGlobal.GetAsSupports()));
nsIDocument* doc = inner ? inner->GetExtantDoc() : nullptr;
if (doc) {
baseURI = doc->GetBaseURI();
}