mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Bug 1098415 - Skip DNS prefetch requests that point to local resources. r=sworkman r=dragana
This commit is contained in:
parent
66ca086aa3
commit
c31d7cf997
@ -852,9 +852,15 @@ nsContentSink::PrefetchDNS(const nsAString &aHref)
|
||||
if (!uri) {
|
||||
return;
|
||||
}
|
||||
nsAutoCString host;
|
||||
uri->GetHost(host);
|
||||
CopyUTF8toUTF16(host, hostname);
|
||||
nsresult rv;
|
||||
bool isLocalResource = false;
|
||||
rv = NS_URIChainHasFlags(uri, nsIProtocolHandler::URI_IS_LOCAL_RESOURCE,
|
||||
&isLocalResource);
|
||||
if (NS_SUCCEEDED(rv) && !isLocalResource) {
|
||||
nsAutoCString host;
|
||||
uri->GetHost(host);
|
||||
CopyUTF8toUTF16(host, hostname);
|
||||
}
|
||||
}
|
||||
|
||||
if (!hostname.IsEmpty() && nsHTMLDNSPrefetch::IsAllowed(mDocument)) {
|
||||
|
Loading…
Reference in New Issue
Block a user