Index: net/dns/dns_transaction.cc |
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc |
index beb2197dd55b7bc50d39c71cb70d46c29bfd2a77..31f6683acd12d9fadf7f9e396c5fdfc85c40a2a3 100644 |
--- a/net/dns/dns_transaction.cc |
+++ b/net/dns/dns_transaction.cc |
@@ -28,6 +28,7 @@ |
#include "net/base/ip_endpoint.h" |
#include "net/base/net_errors.h" |
#include "net/base/net_log.h" |
+#include "net/base/net_util.h" |
#include "net/dns/dns_protocol.h" |
#include "net/dns/dns_query.h" |
#include "net/dns/dns_response.h" |
@@ -563,6 +564,11 @@ class DnsTransactionImpl : public DnsTransaction, |
DCHECK(!hostname_.empty()); |
DCHECK(!callback_.is_null()); |
DCHECK(!IsIPLiteral(hostname_)); |
+ |
+ // Redirect .localhost queries to localhost to make sure that they are |
+ // never sent out on the network, per RFC 6761. |
+ if (IsLocalhostTLD(hostname)) |
+ hostname_ = "localhost"; |
Ryan Sleevi
2015/02/19 22:24:56
No clue if this is correct; This seems wrong/weird
estark
2015/02/20 01:55:19
Ah, I see what you mean. I changed it to use local
|
} |
~DnsTransactionImpl() override { |