diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-22 21:51:49 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-22 21:51:49 +0200 |
commit | 2e33335820b2816bee111e78588ac82e401c86ae (patch) | |
tree | 1f59b2ec96124bb182f34bd6d8222e012656a1c0 /netwerk/base | |
parent | 29bd11c3cd6ff41f7167530f9bbcd9d195b7c427 (diff) | |
download | UXP-2e33335820b2816bee111e78588ac82e401c86ae.tar UXP-2e33335820b2816bee111e78588ac82e401c86ae.tar.gz UXP-2e33335820b2816bee111e78588ac82e401c86ae.tar.lz UXP-2e33335820b2816bee111e78588ac82e401c86ae.tar.xz UXP-2e33335820b2816bee111e78588ac82e401c86ae.zip |
Bug 1182569: Update ContentSecurityManager to handle docshell loads
native in moebius
Diffstat (limited to 'netwerk/base')
-rw-r--r-- | netwerk/base/nsNetUtil.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index 8ff3e788f..bc9bcf88a 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -1285,16 +1285,10 @@ 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"); -#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"); + // TYPE_DOCUMENT loads have a null LoadingPrincipal and can not be cross origin. + if (!loadInfo->LoadingPrincipal()) { + return false; + } // Always treat tainted channels as cross-origin. if (loadInfo->GetTainting() != LoadTainting::Basic) { |