summaryrefslogtreecommitdiffstats
path: root/netwerk
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-22 22:17:09 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-22 22:17:09 +0200
commit115cf1e322bdabaee001781e1d5a8ee4928992af (patch)
tree5eaab80adebcfd3f0a00ab9ac2e5e3e8d0365c97 /netwerk
parent13f3978a14cb90eb01fc7f185f62b2ee2ac9f466 (diff)
downloadUXP-115cf1e322bdabaee001781e1d5a8ee4928992af.tar
UXP-115cf1e322bdabaee001781e1d5a8ee4928992af.tar.gz
UXP-115cf1e322bdabaee001781e1d5a8ee4928992af.tar.lz
UXP-115cf1e322bdabaee001781e1d5a8ee4928992af.tar.xz
UXP-115cf1e322bdabaee001781e1d5a8ee4928992af.zip
Revert "Bug 1182569: Update ContentSecurityManager to handle docshell loads"
This reverts commit 2e33335820b2816bee111e78588ac82e401c86ae.
Diffstat (limited to 'netwerk')
-rw-r--r--netwerk/base/nsNetUtil.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp
index bc9bcf88a..8ff3e788f 100644
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -1285,10 +1285,16 @@ NS_HasBeenCrossOrigin(nsIChannel* aChannel, bool aReport)
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
MOZ_RELEASE_ASSERT(loadInfo, "Origin tracking only works for channels created with a loadinfo");
- // TYPE_DOCUMENT loads have a null LoadingPrincipal and can not be cross origin.
- if (!loadInfo->LoadingPrincipal()) {
- return false;
- }
+#ifdef DEBUG
+ // Don't enforce TYPE_DOCUMENT assertions for loads
+ // initiated by javascript tests.
+ bool skipContentTypeCheck = false;
+ skipContentTypeCheck = Preferences::GetBool("network.loadinfo.skip_type_assertion");
+#endif
+
+ MOZ_ASSERT(skipContentTypeCheck ||
+ loadInfo->GetExternalContentPolicyType() != nsIContentPolicy::TYPE_DOCUMENT,
+ "calling NS_HasBeenCrossOrigin on a top level load");
// Always treat tainted channels as cross-origin.
if (loadInfo->GetTainting() != LoadTainting::Basic) {