j-bernard commented on code in PR #350:
URL: 
https://github.com/apache/httpcomponents-core/pull/350#discussion_r943848540


##########
httpcore5/src/main/java/org/apache/hc/core5/net/Host.java:
##########
@@ -72,7 +73,10 @@ static Host parse(final CharSequence s, final 
Tokenizer.Cursor cursor) throws UR
                 throw URISupport.createException(s, cursor, "Expected an IPv6 
address");
             }
         } else {
-            hostName = tokenizer.parseContent(s, cursor, 
URISupport.PORT_SEPARATORS);
+            // If the hostName contains non-ASCII characters, IDNA processing 
is required
+            hostName = TextUtils.isAllASCII(s) ?
+                    tokenizer.parseContent(s, cursor, 
URISupport.PORT_SEPARATORS) :
+                    IDN.toASCII(tokenizer.parseContent(s, cursor, 
URISupport.PORT_SEPARATORS));

Review Comment:
   java.net.IDN is implementing a deprecated version of IDNA (IDNA 2003). The 
latest version, IDNA 2008, can be supported using the ICU4j library



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