Bug 1184387 - Bail out of file:// loads for all non-chrome:// URIs. r=Gijs

This commit is contained in:
Bobby Holley 2015-08-04 10:42:40 -07:00
parent a6de0c748e
commit b442330ce0

View File

@ -843,18 +843,12 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
}
}
// resource: and chrome: are equivalent, securitywise
// That's bogus!! Fix this. But watch out for
// the view-source stylesheet?
bool sourceIsChrome;
rv = NS_URIChainHasFlags(sourceURI,
nsIProtocolHandler::URI_IS_UI_RESOURCE,
&sourceIsChrome);
NS_ENSURE_SUCCESS(rv, rv);
if (sourceIsChrome) {
// Allow chrome://
if (sourceScheme.EqualsLiteral("chrome")) {
return NS_OK;
}
// Nothing else.
if (reportErrors) {
ReportError(nullptr, errorTag, sourceURI, aTargetURI);
}