Module net_traits::pub_domains
source · Expand description
Implementation of public domain matching.
The list is a file located on the resources
folder and loaded once on first need.
The list can be updated with ./mach update-pub-domains
from this source:
https://publicsuffix.org/list/
This implementation is not strictly following the specification of the list. Wildcards are not
restricted to appear only in the leftmost position, but the current list has no such cases so
we don’t need to make the code more complex for it. The mach
update command makes sure that
those cases are not present.
Structs§
Statics§
Functions§
- The registered domain name (aka eTLD+1) for a URL. Returns None if the URL has no host name. Returns the registered suffix for the host name if it is a domain. Leaves the host name alone if it is an IP address.