diff --git a/java/com/google/domain/registry/rdap/RdapDomainSearchAction.java b/java/com/google/domain/registry/rdap/RdapDomainSearchAction.java index f26154de0..3eb761c81 100644 --- a/java/com/google/domain/registry/rdap/RdapDomainSearchAction.java +++ b/java/com/google/domain/registry/rdap/RdapDomainSearchAction.java @@ -36,6 +36,7 @@ import com.google.domain.registry.request.HttpException.BadRequestException; import com.google.domain.registry.request.HttpException.NotFoundException; import com.google.domain.registry.request.Parameter; import com.google.domain.registry.util.Clock; +import com.google.domain.registry.util.Idn; import com.googlecode.objectify.Key; import com.googlecode.objectify.Ref; @@ -44,7 +45,6 @@ import com.googlecode.objectify.cmd.QueryKeys; import org.joda.time.DateTime; -import java.net.IDN; import java.net.InetAddress; import java.util.List; @@ -102,7 +102,7 @@ public class RdapDomainSearchAction extends RdapActionBase { // TODO(b/24329745): improve IDN handling String asciiName; try { - asciiName = IDN.toASCII(nameParam.get()); + asciiName = Idn.toASCII(nameParam.get()); } catch (Exception e) { throw new BadRequestException("Invalid value of nsLdhName parameter"); } diff --git a/java/com/google/domain/registry/rdap/RdapEntitySearchAction.java b/java/com/google/domain/registry/rdap/RdapEntitySearchAction.java index ef9970439..0d832a161 100644 --- a/java/com/google/domain/registry/rdap/RdapEntitySearchAction.java +++ b/java/com/google/domain/registry/rdap/RdapEntitySearchAction.java @@ -40,8 +40,6 @@ import com.google.domain.registry.util.Clock; import com.googlecode.objectify.Key; import com.googlecode.objectify.cmd.Query; -import java.net.IDN; - import javax.inject.Inject; /** @@ -93,7 +91,8 @@ public class RdapEntitySearchAction extends RdapActionBase { throw new NotImplementedException("Entity name search not implemented"); } else { // syntax: /rdap/entities?handle=12345-* - results = searchByHandle(RdapSearchPattern.create(IDN.toASCII(handleParam.get()), false)); + // The handle is either the contact roid or the registrar clientId. + results = searchByHandle(RdapSearchPattern.create(handleParam.get(), false)); } if (results.isEmpty()) { throw new NotFoundException("No entities found"); diff --git a/java/com/google/domain/registry/rdap/RdapNameserverSearchAction.java b/java/com/google/domain/registry/rdap/RdapNameserverSearchAction.java index 02ce7b45b..b303cf859 100644 --- a/java/com/google/domain/registry/rdap/RdapNameserverSearchAction.java +++ b/java/com/google/domain/registry/rdap/RdapNameserverSearchAction.java @@ -35,12 +35,12 @@ import com.google.domain.registry.request.HttpException.BadRequestException; import com.google.domain.registry.request.HttpException.NotFoundException; import com.google.domain.registry.request.Parameter; import com.google.domain.registry.util.Clock; +import com.google.domain.registry.util.Idn; import com.googlecode.objectify.cmd.Query; import org.joda.time.DateTime; -import java.net.IDN; import java.net.InetAddress; import javax.inject.Inject; @@ -98,7 +98,7 @@ public class RdapNameserverSearchAction extends RdapActionBase { "Name parameter must contain only letters, dots" + " and hyphens, and an optional single wildcard"); } - results = searchByName(RdapSearchPattern.create(IDN.toASCII(nameParam.get()), true), now); + results = searchByName(RdapSearchPattern.create(Idn.toASCII(nameParam.get()), true), now); } else { // syntax: /rdap/nameservers?ip=1.2.3.4 results = searchByIp(ipParam.get());