mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Enforce canonicalization of premium/reserved list labels
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=193401336
This commit is contained in:
parent
c6a4264606
commit
2c0fb6d5a6
7 changed files with 108 additions and 17 deletions
|
@ -41,7 +41,12 @@ public final class DomainNameUtils {
|
|||
|
||||
/** Canonicalizes a domain name by lowercasing and converting unicode to punycode. */
|
||||
public static String canonicalizeDomainName(String label) {
|
||||
return Idn.toASCII(Ascii.toLowerCase(label));
|
||||
String labelLowercased = Ascii.toLowerCase(label);
|
||||
try {
|
||||
return Idn.toASCII(labelLowercased);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new IllegalArgumentException(String.format("Error ASCIIfying label '%s'", label), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue