You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2022/06/18 10:53:52 UTC
[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #350: HTTPCLIENT-2185 Add support for IDNA 2008 (RFC 5891)
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: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org