Chromium Code Reviews| Index: net/dns/host_resolver_impl.cc |
| diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc |
| index 970ec1f457ade5ba90b1b2ac6224f57e782c0271..7d00256d132b08b4b0f2e518be4ce6438156a6c3 100644 |
| --- a/net/dns/host_resolver_impl.cc |
| +++ b/net/dns/host_resolver_impl.cc |
| @@ -1997,6 +1997,17 @@ int HostResolverImpl::ResolveHelper(const Key& key, |
| source_net_log.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_HOSTS_HIT); |
| return OK; |
| } |
| + |
| + // Per RFC 6761 section 6.3, resolve localhost to loopback without |
| + // sending it out on the network. |
| + if (IsLocalhost(base::StringToLowerASCII(key.hostname))) { |
|
Ryan Sleevi
2015/06/11 00:34:03
BUG: Should IsLocalhost be doing the case conversi
estark
2015/06/11 02:35:32
Done.
|
| + addresses->clear(); |
| + IPAddressNumber ip_address; |
| + ParseIPLiteralToNumber("127.0.0.1", &ip_address); |
|
Ryan Sleevi
2015/06/11 00:34:03
BUG 1: This isn't correct for localhost6 (which sh
estark
2015/06/11 02:35:32
Done by factoring out the hostname check of IsLoca
|
| + addresses->push_back(IPEndPoint(ip_address, info.port())); |
| + return OK; |
| + } |
| + |
| return ERR_DNS_CACHE_MISS; |
| } |