Skip to content
Snippets Groups Projects
Verified Commit f7344143 authored by Julian Descottes's avatar Julian Descottes Committed by Pier Angelo Vendrame
Browse files

Bug 1880374 - Disable DNS prefetching if document nodePrincipal is systemPrincipal r=valentin

parent 6eeb44b0
Branches
Tags
1 merge request!1223Bug 43167: Rebased stable onto 115.16.0esr
......@@ -180,6 +180,13 @@ static bool EnsureDNSService() {
}
bool HTMLDNSPrefetch::IsAllowed(Document* aDocument) {
// Do not use prefetch if the document's node principal is the system
// principal.
nsCOMPtr<nsIPrincipal> principal = aDocument->NodePrincipal();
if (principal->IsSystemPrincipal()) {
return false;
}
// There is no need to do prefetch on non UI scenarios such as XMLHttpRequest.
return aDocument->IsDNSPrefetchAllowed() && aDocument->GetWindow();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment