summaryrefslogtreecommitdiff
path: root/docshell/base/nsDocShell.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-30 23:54:01 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-30 23:54:01 +0200
commitd735c1c1ad9b0ebaf24a0d468dda0b69bdaae060 (patch)
treeaa96b937b68f336862b101e5dc6c8dbcd1e56ee8 /docshell/base/nsDocShell.cpp
parent7c759805d0fe7e8f9a3b9f188ae9ed7b3b49eb30 (diff)
downloaduxp-d735c1c1ad9b0ebaf24a0d468dda0b69bdaae060.tar.gz
Bug 1359204 - Use SystemPrincipal as TriggeringPrincipal when loading page as view-source
Diffstat (limited to 'docshell/base/nsDocShell.cpp')
-rw-r--r--docshell/base/nsDocShell.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 8f924567c3..b3e26da333 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -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);