commit a3059a12773caa665c02498534ddf96028035fc3
parent 19be8bc17947fa989d7f66ed62a678b8d391d756
Author: Artur Iunusov <aiunusov@mozilla.com>
Date: Tue, 11 Nov 2025 19:47:14 +0000
Bug 1996555 - Use the TriggeringPrincipal if we have one, not the SystemPrincipal, r=smaug,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D270427
Diffstat:
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/image/imgLoader.cpp b/image/imgLoader.cpp
@@ -928,12 +928,14 @@ static nsresult NewImageChannel(
} else {
// either we are loading something inside a document, in which case
// we should always have a requestingNode, or we are loading something
- // 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 process in which case we can't get a
- // requestingNode.
- rv = NS_NewChannel(aResult, aURI, nsContentUtils::GetSystemPrincipal(),
+ // outside a document, in which case the triggeringPrincipal should be the
+ // systemPrincipal. However, there are exceptions: one is Notifications
+ // which create a channel in the parent process in which case we can't get a
+ // requestingNode though we might have a valid triggeringPrincipal.
+ rv = NS_NewChannel(aResult, aURI,
+ aTriggeringPrincipal
+ ? aTriggeringPrincipal
+ : nsContentUtils::GetSystemPrincipal(),
securityFlags, aPolicyType,
nullptr, // nsICookieJarSettings
nullptr, // PerformanceStorage