Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-2259

PublicSuffixMatcher returning incomplete domain root for private domains

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Information Provided
    • 5.2.1
    • None
    • HttpClient (classic)
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            andreidan Andrei Dan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: