Skip to content

Commit

Permalink
Merge pull request #4501 from square/jwilson.1230.malformed_ipv6
Browse files Browse the repository at this point in the history
Test malformed IPv6 addresses
  • Loading branch information
swankjesse authored Dec 30, 2018
2 parents e8acc61 + 8da92eb commit 0500828
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions okhttp-tests/src/test/java/okhttp3/HttpUrlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 0500828

Please sign in to comment.