You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (Jira)" <ji...@apache.org> on 2023/02/17 09:36:00 UTC

[jira] [Commented] (HTTPCLIENT-2259) PublicSuffixMatcher returning incomplete domain root for private domains

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-2259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17690288#comment-17690288 ] 

Oleg Kalnichevski commented on HTTPCLIENT-2259:
-----------------------------------------------

[~andreidan] Is this a bug report or a question? 

The method `#getDomainRoot` returns the root of the registrable domain as its method name implies. 

You can see the expected behavior of the method in this test suite
https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/test/java/org/apache/hc/client5/http/psl/TestPublicSuffixMatcher.java

Oleg 

> PublicSuffixMatcher returning incomplete domain root for private domains
> ------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-2259
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2259
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (classic)
>    Affects Versions: 5.2.1
>            Reporter: Andrei Dan
>            Priority: Minor
>
> Hello,
> I'm testing *org.apache.hc.client5.http.psl.PublicSuffixMatcher* from *org.apache.httpcomponents.client5* version {*}5.2.1{*}.
> First, running *getDomainRoot* for "test.co.uk" returns, as expected, "test.co.uk".
> No problem here! I'm just taking note of this to contrast it with the behavior described below.
> But then, running *getDomainRoot* for "test.blogspot.com" returns "blogspot.com".
> This doesn't change even if I add the second parameter as {*}DomainType.PRIVATE{*}.
> Shouldn't the returned domain root be "test.blogspot.com", as "blogspot.com" is registered in the hardcoded PSL as a public suffix? I also tried instantiating a *PublicSuffixMatcher* with the latest Mozilla PSL, using {*}PublicSuffixMatcherLoader.load{*}, and noticed no change.
> The method documentation for *getDomainRoot* says:
> ??Returns registrable part of the domain for the given domain name or null if given domain represents a public suffix.??
> But it is "test.blogspot.com" that is registrable, not "blogspot.com" itself.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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