Backed out changeset ca88862d6b63 (bug 1558915) for causing build bustages on StartupCacheUtils. CLOSED TREE
This commit is contained in:
@@ -688,6 +688,8 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
|
||||
"security.view-source.reachable-from-inner-protocol");
|
||||
}
|
||||
|
||||
bool targetIsViewSource = false;
|
||||
|
||||
if (sourceScheme.LowerCaseEqualsLiteral(NS_NULLPRINCIPAL_SCHEME)) {
|
||||
// A null principal can target its own URI.
|
||||
if (sourceURI == aTargetURI) {
|
||||
@@ -695,7 +697,9 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
|
||||
}
|
||||
} else if (sViewSourceReachableFromInner &&
|
||||
sourceScheme.EqualsIgnoreCase(targetScheme.get()) &&
|
||||
aTargetURI->SchemeIs("view-source")) {
|
||||
NS_SUCCEEDED(
|
||||
aTargetURI->SchemeIs("view-source", &targetIsViewSource)) &&
|
||||
targetIsViewSource) {
|
||||
// exception for foo: linking to view-source:foo for reftests...
|
||||
return NS_OK;
|
||||
} else if (sourceScheme.EqualsIgnoreCase("file") &&
|
||||
@@ -944,7 +948,9 @@ nsresult nsScriptSecurityManager::CheckLoadURIFlags(
|
||||
}
|
||||
|
||||
// Allow chrome://
|
||||
if (aSourceBaseURI->SchemeIs("chrome")) {
|
||||
bool isChrome = false;
|
||||
if (NS_SUCCEEDED(aSourceBaseURI->SchemeIs("chrome", &isChrome)) &&
|
||||
isChrome) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user