Backed out changeset c07ec5ce9aa1 (bug 1894662) for causing xpcshell failures in test_ext_dnr_private_browsing.js. CLOSED TREE

This commit is contained in:
Stanca Serban 2024-05-09 00:51:36 +03:00
parent 4d84ebb4d2
commit 23428021fd

View file

@ -537,26 +537,12 @@ nsHTTPSOnlyUtils::PotentiallyDowngradeHttpsFirstRequest(
// We're only downgrading if it's possible that the error was
// caused by the upgrade.
nsCOMPtr<nsIHttpChannelInternal> httpChannelInternal(
do_QueryInterface(channel));
if (!httpChannelInternal) {
return nullptr;
}
bool proxyUsed = false;
nsresult rv = httpChannelInternal->GetIsProxyUsed(&proxyUsed);
MOZ_ASSERT(NS_SUCCEEDED(rv));
if (!(proxyUsed && status == nsresult::NS_ERROR_UNKNOWN_HOST)
// When a proxy returns an error code it is converted by
// HttpProxyResponseToErrorCode. We do want to downgrade in
// that case. If the host is actually unreachable this will
// show the same error page, but technically for the HTTP
// site not the HTTPS site.
&& HttpsUpgradeUnrelatedErrorCode(status)) {
if (HttpsUpgradeUnrelatedErrorCode(status)) {
return nullptr;
}
nsCOMPtr<nsIURI> uri;
rv = channel->GetURI(getter_AddRefs(uri));
nsresult rv = channel->GetURI(getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, nullptr);
nsAutoCString spec;