diff --git a/caps/src/nsScriptSecurityManager.cpp b/caps/src/nsScriptSecurityManager.cpp index df36a8d470e..fad1c515f53 100644 --- a/caps/src/nsScriptSecurityManager.cpp +++ b/caps/src/nsScriptSecurityManager.cpp @@ -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; } diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp index e2511bcd419..122a80db43c 100644 --- a/netwerk/build/nsNetModule.cpp +++ b/netwerk/build/nsNetModule.cpp @@ -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", diff --git a/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp b/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp index df01280ca1a..52dbbc454e3 100644 --- a/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp +++ b/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp @@ -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 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);