mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 13:58:49 +00:00
[image] Use the TriggeringPrincipal if we have one, not the SystemPrincipal
This commit is contained in:
+5
-2
@@ -751,10 +751,13 @@ NewImageChannel(nsIChannel** aResult,
|
||||
// outside a document, in which case the triggeringPrincipal and
|
||||
// triggeringPrincipal should always be the systemPrincipal.
|
||||
// However, there are exceptions: one is Notifications which create a
|
||||
// channel in the parent prcoess in which case we can't get a requestingNode.
|
||||
// channel separate from content, in which case we can't get a
|
||||
// requestingNode while we might still have a valid triggering principal.
|
||||
// Use the triggering principal if we have a valid one, fall back to
|
||||
// the system principal if we don't.
|
||||
rv = NS_NewChannel(aResult,
|
||||
aURI,
|
||||
nsContentUtils::GetSystemPrincipal(),
|
||||
aTriggeringPrincipal ? aTriggeringPrincipal : nsContentUtils::GetSystemPrincipal(),
|
||||
securityFlags,
|
||||
aPolicyType,
|
||||
nullptr, // loadGroup
|
||||
|
||||
Reference in New Issue
Block a user