equal
deleted
inserted
replaced
458 throw new |
458 throw new |
459 IllegalArgumentException("invalid host wildcard specification"); |
459 IllegalArgumentException("invalid host wildcard specification"); |
460 } |
460 } |
461 return; |
461 return; |
462 } else { |
462 } else { |
463 if (host.length() > 0) { |
463 if (!host.isEmpty()) { |
464 // see if we are being initialized with an IP address. |
464 // see if we are being initialized with an IP address. |
465 char ch = host.charAt(0); |
465 char ch = host.charAt(0); |
466 if (ch == ':' || Character.digit(ch, 16) != -1) { |
466 if (ch == ':' || Character.digit(ch, 16) != -1) { |
467 byte ip[] = IPAddressUtil.textToNumericFormatV4(host); |
467 byte ip[] = IPAddressUtil.textToNumericFormatV4(host); |
468 if (ip == null) { |
468 if (ip == null) { |
703 hdomain = RegisteredDomain.from(b) |
703 hdomain = RegisteredDomain.from(b) |
704 .map(RegisteredDomain::name) |
704 .map(RegisteredDomain::name) |
705 .orElse(b); |
705 .orElse(b); |
706 } |
706 } |
707 |
707 |
708 return cdomain.length() != 0 && hdomain.length() != 0 |
708 return !cdomain.isEmpty() && !hdomain.isEmpty() && cdomain.equals(hdomain); |
709 && cdomain.equals(hdomain); |
|
710 } |
709 } |
711 |
710 |
712 private boolean authorized(String cname, byte[] addr) { |
711 private boolean authorized(String cname, byte[] addr) { |
713 if (addr.length == 4) |
712 if (addr.length == 4) |
714 return authorizedIPv4(cname, addr); |
713 return authorizedIPv4(cname, addr); |