diff --git a/okhttp-tests/src/test/java/okhttp3/HttpUrlTest.java b/okhttp-tests/src/test/java/okhttp3/HttpUrlTest.java index 242248d713b3..9e3c0c888efd 100644 --- a/okhttp-tests/src/test/java/okhttp3/HttpUrlTest.java +++ b/okhttp-tests/src/test/java/okhttp3/HttpUrlTest.java @@ -534,6 +534,10 @@ HttpUrl parse(String url) { "Invalid URL host: \"[0:0:0:0:0:1:255.255.255]\""); } + @Test public void hostIpv6Malformed() throws Exception { + assertInvalid("http://[::g]/", "Invalid URL host: \"[::g]\""); + } + @Test public void hostIpv6CanonicalForm() throws Exception { assertEquals("abcd:ef01:2345:6789:abcd:ef01:2345:6789", parse("http://[abcd:ef01:2345:6789:abcd:ef01:2345:6789]/").host());