carterkozak commented on a change in pull request #279:
URL: 
https://github.com/apache/httpcomponents-core/pull/279#discussion_r607292035



##########
File path: httpcore5/src/test/java/org/apache/hc/core5/net/TestURIAuthority.java
##########
@@ -220,4 +220,27 @@ public void testCreateFromString() throws Exception {
         }
     }
 
+    @Test
+    public void testCreateFromIPv6String() throws Exception {
+        Assert.assertEquals(new URIAuthority("::1", 8080), 
URIAuthority.create("[::1]:8080"));
+        Assert.assertEquals(new URIAuthority("::1", -1), 
URIAuthority.create("[::1]"));
+        try {
+            URIAuthority.create("::1");

Review comment:
       I'm not sure that this case should fail -- we allow hostnames without 
ports to succeed `URIAuthority.create("hostname")`, so we may want to allow raw 
ipv6 addresses to succeed as well. On the other hand, if a port is present, it 
requires the address to be bracketed to avoid ambiguity, which may result in 
non-obvious failures depending where the value is coming from.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to