ok2c commented on code in PR #431:
URL:
https://github.com/apache/httpcomponents-client/pull/431#discussion_r1159381453
##########
httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpClientBuilder.java:
##########
@@ -751,6 +766,26 @@ public CloseableHttpClient build() {
}
}
+ if (enableIDNConversion && schemePortResolver == null) {
+ // Load the public suffix list
+ final PublicSuffixMatcher publicSuffixMatcher =
PublicSuffixMatcherLoader.getDefault();
+
+ schemePortResolver = new DefaultSchemePortResolver() {
+ @Override
+ public int resolve(final HttpHost host) {
+ final String hostname = IDN.toASCII(host.getHostName());
Review Comment:
@arturobernalg Look. I understand what the IDN encoding is for and why it is
necessary but please understand what I am trying to say here. The hostname
encoding makes no difference on the result of the `SchemePortResolver`. It
produces the same result for both versions because it does not take the host
name into consideration. At all.
```
http://www.öbb.at -> 80
http://www.xn--bb-eka.at -> 80
```
The IDN conversion should take place in `HttpHost` and nowhere else. The
`SchemePortResolver` is simply the wrong place.
--
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]