Bug 911444 part 3. Store the principal a PDF viewer document would have had if the PDF viewer had not messed with the principal. r=bdahl,bholley

Differential Revision: https://phabricator.services.mozilla.com/D63709

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Boris Zbarsky 2020-02-27 14:54:53 +00:00
parent aa65e88c73
commit 4750163d3b

View File

@ -1182,7 +1182,12 @@ PdfStreamConverter.prototype = {
uri,
aRequest.loadInfo.originAttributes
);
// Remember the principal we would have had before we mess with it.
let originalPrincipal = Services.scriptSecurityManager.getChannelResultPrincipal(
aRequest
);
aRequest.owner = resourcePrincipal;
aRequest.setProperty("noPDFJSPrincipal", originalPrincipal);
channel.asyncOpen(proxy);
},