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



##########
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:
       Yes, however we define the contract for `URIAuthority.create` so we 
could say:
   1. If the input string is a valid IPv6 address, we assume the full contents 
represent that address with the default port `-1`
   2. Otherwise brackets must be used when a port is present
   
   But that would too complicated for users to understand (or us to maintain), 
so you're right, it should stay as is.




-- 
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