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


##########
httpcore5/src/main/java/org/apache/hc/core5/net/Host.java:
##########
@@ -71,7 +73,10 @@ static Host parse(final CharSequence s, final 
Tokenizer.Cursor cursor) throws UR
             if (!InetAddressUtils.isIPv6Address(hostName)) {
                 throw URISupport.createException(s, cursor, "Expected an IPv6 
address");
             }
-        } else {
+        }  else if 
(!StandardCharsets.US_ASCII.newEncoder().canEncode(s.toString())){

Review Comment:
   @hanasakari I suspect this operation can be relative expensive. Could you 
please add a method to `TextUtils` that performs the same test without extra 
object allocation? 
   Please also note that it is likely to be more efficient to execute the test 
and IDN transformation _after_ `tokenizer#parseContent` parsing operation.



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