Module 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§

PubDomainRules

Statics§

PUB_DOMAINS 🔒

Functions§

is_pub_domain
is_reg_domain
load_pub_domains 🔒
pub_suffix
public_suffix_list_size_of
reg_host
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.
reg_suffix