| Index: net/dns/mock_host_resolver.cc
|
| diff --git a/net/dns/mock_host_resolver.cc b/net/dns/mock_host_resolver.cc
|
| index 4f6dc1c6cd270d41e98d8bd8e04e89093f79f3f1..08fe463cb534c70ab804ee01da580145c2c73ce3 100644
|
| --- a/net/dns/mock_host_resolver.cc
|
| +++ b/net/dns/mock_host_resolver.cc
|
| @@ -113,12 +113,16 @@ int MockHostResolverBase::Resolve(const RequestInfo& info,
|
| num_resolve_++;
|
| size_t id = next_request_id_++;
|
| int rv = ResolveFromIPLiteralOrCache(info, addresses);
|
| - if (rv != ERR_DNS_CACHE_MISS) {
|
| + if (rv != ERR_DNS_CACHE_MISS)
|
| return rv;
|
| - }
|
| - if (synchronous_mode_) {
|
| +
|
| + // Just like the real resolver, refuse to do anything with invalid hostnames.
|
| + if (!IsValidDNSDomain(info.hostname()))
|
| + return ERR_NAME_NOT_RESOLVED;
|
| +
|
| + if (synchronous_mode_)
|
| return ResolveProc(info, addresses);
|
| - }
|
| +
|
| // Store the request for asynchronous resolution
|
| std::unique_ptr<RequestImpl> req(
|
| new RequestImpl(info, addresses, callback, this, id));
|
|
|