ok2c commented on code in PR #571:
URL: 
https://github.com/apache/httpcomponents-core/pull/571#discussion_r2422746043


##########
httpcore5/src/main/java/org/apache/hc/core5/http/HttpHost.java:
##########
@@ -303,13 +304,24 @@ public InetAddress getAddress() {
      */
     public String toURI() {
         final StringBuilder buffer = new StringBuilder();
-        buffer.append(this.schemeName);
-        buffer.append("://");
-        buffer.append(this.host.toString());
+        buffer.append(this.schemeName).append("://");
+
+        final String hostname = this.host.getHostName();
+        final int port = this.host.getPort();
+
+        // Bracket only real IPv6 literals; decide using the address part only 
(ignore zone)
+        if (ZoneIdSupport.isIPv6AddressPart(hostname)) {
+            ZoneIdSupport.appendBracketedIPv6(buffer, hostname);

Review Comment:
   @arturobernalg `#isIPv6AddressPart` still gets called twice. Once here, and 
another time inside `#appendBracketedIPv6`



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

To unsubscribe, e-mail: [email protected]

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