Closed FGasper closed 8 years ago
I don't really understand your problem. For any domain which does not have special handling the public suffix the public suffix consists of a single part. For co.nz
there is a special handling which means that it will return co.nz
as public suffix when asked for q.co.nz
. For com
or nzzzzzz
there is no special handling which means that the public suffix for ebay.com
will be com
and for q.co.nzzzzzz
will be nzzzzzz
.
The desire is to validate TLDs, similar to the tldExists() method in this library:
You are trying to use PublicSuffix for something it is not intended for. Keeping list of which TLD exist is not the task of the public suffix list. The purpose is not to find out if there is some TLD .nz but if there is a single owner for co.nz or if all the subdomains below co.nz might have a different owner. In fact rule#2 in the algorithm specified in https://publicsuffix.org/list/ says to use *
if no rules match, which implicitly means that hostnames with a toplevel not inside the public suffix list are considered to have only a single level of public suffix.
^^^ The above seems to indicate that the “TLD” for the 2nd domain is “nzzzz”. There is nothing that a caller can do to distinguish this from the case where “nzzzz” is a real TLD.
This seems like a problem … ? Potentially one causing breakage in IO::Socket::SSL?