Replaces uses of java.net.IDN with our Idn stand in class

java.net.IDN uses outdated IDNA2003. We've created a replacement
class that uses the modern UTS46 transitional standard via the
IDNA library. This fixes uses of IDN in the RDAP code.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117243868
This commit is contained in:
cgoldfeder 2016-03-15 09:03:53 -07:00 committed by Justine Tunney
parent 46e02c6bd1
commit 5f7bf57cf9
3 changed files with 6 additions and 7 deletions

View file

@ -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");
}