Index: net/dns/host_resolver_proc.cc |
diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc |
index f2b10c649bad49e5d083024a45e04594f91324f6..900573ebc6f3a914a9cb628dd4ca6642a69aabf3 100644 |
--- a/net/dns/host_resolver_proc.cc |
+++ b/net/dns/host_resolver_proc.cc |
@@ -11,6 +11,7 @@ |
#include "net/base/address_list.h" |
#include "net/base/dns_reloader.h" |
#include "net/base/net_errors.h" |
+#include "net/base/net_util.h" |
#include "net/base/sys_addrinfo.h" |
#if defined(OS_OPENBSD) |
@@ -189,7 +190,11 @@ int SystemHostResolverCall(const std::string& host, |
!defined(OS_ANDROID) |
DnsReloaderMaybeReload(); |
#endif |
- int err = getaddrinfo(host.c_str(), NULL, &hints, &ai); |
+ |
+ // Redirect .localhost queries to localhost to make sure that they are |
Deprecated (see juliatuttle)
2015/02/24 16:39:23
Nit: ditto.
|
+ // never sent out on the network, per RFC 6761. |
+ int err = getaddrinfo(IsLocalhostTLD(host) ? "localhost." : host.c_str(), |
+ NULL, &hints, &ai); |
bool should_retry = false; |
// If the lookup was restricted (either by address family, or address |
// detection), and the results where all localhost of a single family, |