X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Futil%2FDomainAssessment.java;h=f48012f8bc43223915c3341a2b4aa2e309f25b18;hp=5070e5cb3e669d73d5011670eaf1a3ccfd1d7e72;hb=b05ce94112d4aa98c6fe6eba0ceddf973d3f09b2;hpb=753aae17442cbcdfcbce2d720b7b5dfd13918294 diff --git a/src/org/cacert/gigi/util/DomainAssessment.java b/src/org/cacert/gigi/util/DomainAssessment.java index 5070e5cb..f48012f8 100644 --- a/src/org/cacert/gigi/util/DomainAssessment.java +++ b/src/org/cacert/gigi/util/DomainAssessment.java @@ -72,7 +72,7 @@ public class DomainAssessment { return financial.contains(suffix); } - public static void checkCertifiableDomain(String domain, boolean hasPunycodeRight) throws GigiApiException { + public static void checkCertifiableDomain(String domain, boolean hasPunycodeRight, boolean asRegister) throws GigiApiException { if (isHighFinancialValue(domain)) { throw new GigiApiException("Domain blocked for automatic adding."); } @@ -80,6 +80,7 @@ public class DomainAssessment { if (parts.length < 2) { throw new GigiApiException("Domain does not contain '.'."); } + boolean neededPunycode = false; for (int i = parts.length - 1; i >= 0; i--) { if ( !isValidDomainPart(parts[i])) { @@ -99,9 +100,11 @@ public class DomainAssessment { throw new GigiApiException("Punycode not allowed under this TLD."); } - String publicSuffix = PublicSuffixes.getInstance().getRegistrablePart(domain); - if ( !domain.equals(publicSuffix)) { - throw new GigiApiException("You may only register a domain with exactly one label before the public suffix."); + if (asRegister) { + String publicSuffix = PublicSuffixes.getInstance().getRegistrablePart(domain); + if ( !domain.equals(publicSuffix)) { + throw new GigiApiException("You may only register a domain with exactly one label before the public suffix."); + } } if (("." + domain).matches("(\\.[0-9]*)*")) {