Skip to content

Commit db9672f

Browse files
fix checkstyle issue
1 parent 66a46b5 commit db9672f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

utils/src/main/java/com/cloud/utils/UriUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.io.IOException;
2424
import java.io.InputStream;
2525
import java.net.HttpURLConnection;
26-
import java.net.Inet6Address;
2726
import java.net.InetAddress;
2827
import java.net.URI;
2928
import java.net.URISyntaxException;
@@ -283,6 +282,9 @@ public static Pair<String, Integer> validateUrl(String format, String url) throw
283282
if (hostAddr.isAnyLocalAddress() || hostAddr.isLinkLocalAddress() || hostAddr.isLoopbackAddress() || hostAddr.isMulticastAddress()) {
284283
throw new IllegalArgumentException("Illegal host specified in url");
285284
}
285+
if (hostAddr instanceof Inet6Address) {
286+
throw new IllegalArgumentException("IPV6 addresses not supported (" + hostAddr.getHostAddress() + ")");
287+
}
286288
} catch (UnknownHostException uhe) {
287289
throw new IllegalArgumentException("Unable to resolve " + host);
288290
}

0 commit comments

Comments
 (0)