massdosage commented on code in PR #629:
URL: 
https://github.com/apache/httpcomponents-client/pull/629#discussion_r2021351749


##########
httpclient5/src/test/java/org/apache/hc/client5/http/psl/TestPublicSuffixMatcher.java:
##########
@@ -284,14 +284,14 @@ void testGetDomainRootPublicSuffixList() {
         checkPublicSuffix("shishi.中国", "shishi.中国");
         checkPublicSuffix("中国", null);
         // Same as above, but punycoded.
-        checkPublicSuffix("xn--85x722f.com.cn", "xn--85x722f.com.cn");
-        checkPublicSuffix("xn--85x722f.xn--55qx5d.cn", 
"xn--85x722f.xn--55qx5d.cn");
-        checkPublicSuffix("www.xn--85x722f.xn--55qx5d.cn", 
"xn--85x722f.xn--55qx5d.cn");
-        checkPublicSuffix("shishi.xn--55qx5d.cn", "shishi.xn--55qx5d.cn");
+        checkPublicSuffix("xn--85x722f.Com.Cn", "食狮.com.cn");
+        checkPublicSuffix("xn--85x722f.xn--55qx5d.CN", "食狮.公司.cn");
+        checkPublicSuffix("www.xn--85x722f.xn--55qx5d.cn", "食狮.公司.cn");
+        checkPublicSuffix("shishi.xn--55qx5d.cn", "shishi.公司.cn");
         checkPublicSuffix("xn--55qx5d.cn", null);
-        checkPublicSuffix("xn--85x722f.xn--fiqs8s", "xn--85x722f.xn--fiqs8s");
-        checkPublicSuffix("www.xn--85x722f.xn--fiqs8s", 
"xn--85x722f.xn--fiqs8s");
-        checkPublicSuffix("shishi.xn--fiqs8s", "shishi.xn--fiqs8s");
+        checkPublicSuffix("xn--85x722f.xn--fiqs8s", "食狮.中国");
+        checkPublicSuffix("www.xn--85x722f.xn--fiqs8s", "食狮.中国");
+        checkPublicSuffix("shishi.xn--fiqs8s", "shishi.中国");

Review Comment:
   We would use something else but this is the best one that doesn't require 
constant updating (the one in Guava seems to be a hardcoded list of regular 
expressions that they maintain and we're trying to avoid a dependency on 
Guava). The alternative is to fork this internally which is what we had done 
but then we contributed the code here as we thought others might also want the 
"formal" behaviour. If you think the formal definition unit tests are wrong and 
should look like what you have here we could raise a discussion there? To me 
the formal one seems to respect "punycode in, punycode out" and "unicode in, 
unicode out" not "punycode in, unicode out" which is what this now does.



-- 
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-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to