Bug 1359204 - Use SystemPrincipal as TriggeringPrincipal when loading page as view-source

This commit is contained in:
janekptacijarabaci 2018-04-30 23:54:01 +02:00 committed by Roy Tam
commit e31712c143

View file

@ -5689,6 +5689,11 @@ nsDocShell::LoadPage(nsISupports* aPageDescriptor, uint32_t aDisplayType)
}
shEntry->SetURI(newUri);
shEntry->SetOriginalURI(nullptr);
// shEntry's current triggering principal is whoever loaded that page initially.
// But now we're doing another load of the page, via an API that is only exposed
// to system code. The triggering principal for this load should be the system
// principal.
shEntry->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
}
rv = LoadHistoryEntry(shEntry, LOAD_HISTORY);