зеркало из https://github.com/mozilla/pjs.git
Fiox the special-casing for about:blank to deal with it now being
moz-safe-about:blank as far as the security manager is concerned. Bug 342108, r=darin, sr=jst
This commit is contained in:
Родитель
6c8d302694
Коммит
714b309562
|
@ -918,7 +918,7 @@ nsScriptSecurityManager::CheckSameOriginPrincipalInternal(nsIPrincipal* aSubject
|
|||
nsXPIDLCString origin;
|
||||
rv = aObject->GetOrigin(getter_Copies(origin));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (nsCRT::strcasecmp(origin, "about:blank") == 0)
|
||||
if (nsCRT::strcasecmp(origin, "moz-safe-about:blank") == 0)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -989,7 +989,7 @@ static const nsModuleComponentInfo gNetModuleInfo[] = {
|
|||
},
|
||||
{ NS_SAFEABOUTPROTOCOLHANDLER_CLASSNAME,
|
||||
NS_SAFEABOUTPROTOCOLHANDLER_CID,
|
||||
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "safe-about",
|
||||
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-safe-about",
|
||||
nsSafeAboutProtocolHandlerConstructor
|
||||
},
|
||||
{ "about:blank",
|
||||
|
|
|
@ -117,10 +117,18 @@ nsAboutProtocolHandler::NewURI(const nsACString &aSpec,
|
|||
}
|
||||
|
||||
if (isSafe) {
|
||||
// We need to indicate that this baby is safe. Use an inner
|
||||
// URI that no one but the security manager will see.
|
||||
// We need to indicate that this baby is safe. Use an inner URI that
|
||||
// no one but the security manager will see. Make sure to preserve our
|
||||
// path, in case someone decides to hardcode checks for particular
|
||||
// about: URIs somewhere.
|
||||
nsCAutoString spec;
|
||||
rv = url->GetPath(spec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
spec.Insert("moz-safe-about:", 0);
|
||||
|
||||
nsCOMPtr<nsIURI> inner;
|
||||
rv = NS_NewURI(getter_AddRefs(inner), "moz-safe-about:x");
|
||||
rv = NS_NewURI(getter_AddRefs(inner), spec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsSimpleNestedURI* outer = new nsSimpleNestedURI(inner);
|
||||
|
|
Загрузка…
Ссылка в новой задаче