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 2020-08-26 15:22:40 +00:00
parent a9c523c4c8
commit 718e32fae5
2 changed files with 13 additions and 2 deletions

View File

@ -197,9 +197,19 @@ bool nsHTTPSOnlyUtils::CouldBeHttpsOnlyError(nsIChannel* aChannel,
return false;
}
// If the load is exempt, then there is nothing to do here.
// httpsOnlyStatus is reset to it's default value in the child-process after
// our forced timeout. Until we figure out why it's reset (bug 1661275) we
// have this workaround:
uint32_t httpsOnlyStatus = loadInfo->GetHttpsOnlyStatus();
if (httpsOnlyStatus & nsILoadInfo::HTTPS_ONLY_EXEMPT) {
if (httpsOnlyStatus & nsILoadInfo::HTTPS_ONLY_UNINITIALIZED &&
!XRE_IsParentProcess() && aError == NS_ERROR_NET_TIMEOUT) {
return true;
}
// If the load is exempt or did not get upgraded,
// then there is nothing to do here.
if (httpsOnlyStatus & nsILoadInfo::HTTPS_ONLY_EXEMPT ||
httpsOnlyStatus & nsILoadInfo::HTTPS_ONLY_UNINITIALIZED) {
return false;
}

View File

@ -91,6 +91,7 @@ class AboutHttpsOnlyErrorParent extends JSWindowActorParent {
: newURI.spec;
aBrowser.loadURI(insecureSpec, {
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
loadFlags: Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY,
});
}