mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 01:35:35 +00:00
Bug 1544008 - re-allow systemprincipal load for discovery pane r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D27291 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
cea888163f
commit
d372b94f5f
@ -776,6 +776,27 @@ static void AssertSystemPrincipalMustNotLoadRemoteDocuments(
|
||||
!nsContentUtils::SchemeIs(finalURI, "ftp")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME The discovery feature in about:addons uses the SystemPrincpal.
|
||||
// We should remove this exception with bug 1544011.
|
||||
static nsAutoCString sDiscoveryPrePath;
|
||||
static bool recvdPrefValue = false;
|
||||
if (!recvdPrefValue) {
|
||||
nsAutoCString discoveryURLString;
|
||||
Preferences::GetCString("extensions.webservice.discoverURL", discoveryURLString);
|
||||
// discoverURL is by default suffixed with parameters in path like /%LOCALE%/
|
||||
// so, we use the prePath for comparison
|
||||
nsCOMPtr<nsIURI> discoveryURL;
|
||||
NS_NewURI(getter_AddRefs(discoveryURL), discoveryURLString);
|
||||
discoveryURL->GetPrePath(sDiscoveryPrePath);
|
||||
recvdPrefValue = true;
|
||||
}
|
||||
nsAutoCString requestedPrePath;
|
||||
finalURI->GetPrePath(requestedPrePath);
|
||||
if (requestedPrePath.Equals(sDiscoveryPrePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (xpc::AreNonLocalConnectionsDisabled()) {
|
||||
bool disallowSystemPrincipalRemoteDocuments = Preferences::GetBool(
|
||||
"security.disallow_non_local_systemprincipal_in_tests");
|
||||
|
Loading…
Reference in New Issue
Block a user