Bug 1424917 - Remove support for HSTS Priming. r=mayhemer, r=ckerschb

This patch removes support and tests for HSTS priming from the tree.
This commit is contained in:
Kate McKinley
2018-01-10 11:07:00 -05:00
parent 8c1d2dc3b1
commit 400d720dc9
65 changed files with 26 additions and 2828 deletions

View File

@@ -9557,27 +9557,6 @@ nsDocShell::InternalLoad(nsIURI* aURI,
return NS_ERROR_CONTENT_BLOCKED;
}
// If HSTS priming was set by nsMixedContentBlocker::ShouldLoad, and we
// would block due to mixed content, go ahead and block here. If we try to
// proceed with priming, we will error out later on.
nsCOMPtr<nsIDocShell> docShell = NS_CP_GetDocShellFromContext(requestingContext);
// When loading toplevel windows, requestingContext can be null. We don't
// really care about HSTS in that situation, though; loads in toplevel
// windows should all be browser UI.
if (docShell) {
nsIDocument* document = docShell->GetDocument();
NS_ENSURE_TRUE(document, NS_OK);
HSTSPrimingState state = document->GetHSTSPrimingStateForLocation(aURI);
if (state == HSTSPrimingState::eHSTS_PRIMING_BLOCK) {
// HSTS Priming currently disabled for InternalLoad, so we need to clear
// the location that was added by nsMixedContentBlocker::ShouldLoad
// Bug 1269815 will address images loaded via InternalLoad
document->ClearHSTSPrimingLocation(aURI);
return NS_ERROR_CONTENT_BLOCKED;
}
}
}
nsCOMPtr<nsIPrincipal> principalToInherit = aPrincipalToInherit;