Bug 1661077 - HTTPS-Only error page only shows up after a failed upgrade. r=ckerschb

Differential Revision: https://phabricator.services.mozilla.com/D88166
This commit is contained in:
julianwels committed 2020-08-25 18:21:20 +00:00
1 parent 987dc664a5
commit 133227172b
2 files changed
+5 -2

No files matched your search

+4 -2
View File
@@ -197,9 +197,11 @@ bool nsHTTPSOnlyUtils::CouldBeHttpsOnlyError(nsIChannel* aChannel,
return false;
}
// If the load is exempt, then there is nothing to do here.
// If the load is exempt or did not get upgraded,
// then there is nothing to do here.
uint32_t httpsOnlyStatus = loadInfo->GetHttpsOnlyStatus();
if (httpsOnlyStatus & nsILoadInfo::HTTPS_ONLY_EXEMPT) {
if (httpsOnlyStatus & nsILoadInfo::HTTPS_ONLY_EXEMPT ||
httpsOnlyStatus & nsILoadInfo::HTTPS_ONLY_UNINITIALIZED) {
return false;
}
@@ -91,6 +91,7 @@ class AboutHttpsOnlyErrorParent extends JSWindowActorParent {
: newURI.spec;
aBrowser.loadURI(insecureSpec, {
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
loadFlags: Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY,
});
}