Functions for interfacing with Mozilla Public Suffix List format files.
The supported format is an extended version of the PSL format. There are two differences:
Lines beginning with # are considered to be comments in addition to lines
beginning with //.
Supports a new "dynamic" rule type, indicated by prefixing a domain with a
+ character. Dynamic rules act as per normal rules, unless the lookup
domain is identical to the suffix domain. In that that case, the lookup
falls through to the next matching rule instead of terminating with a null
result.
See the tests for examples.
Functions for interfacing with Mozilla Public Suffix List format files. The supported format is an extended version of the PSL format. There are two differences: - Lines beginning with `#` are considered to be comments in addition to lines beginning with `//`. - Supports a new "dynamic" rule type, indicated by prefixing a domain with a `+` character. Dynamic rules act as per normal rules, unless the lookup domain is identical to the suffix domain. In that that case, the lookup falls through to the next matching rule instead of terminating with a null result. See the tests for examples.
URL of the default Mozilla Public Suffix List file.
URL of the default Mozilla Public Suffix List file.
(load source)(load source {:keys [sections] :or {sections #{:private :icann}}})Load a Mozilla Public Suffix List format file from the Reader source.
The optional opts map supports:
:sections - a set drawn from #{:icann :private} selecting which
sections of the list to include. The PSL is partitioned by the
// ===BEGIN ICANN DOMAINS=== and // ===BEGIN PRIVATE DOMAINS=== marker
comments; pass #{:icann} to ignore the user-contributed PRIVATE section.
Defaults to both sections (the historical behavior).Load a Mozilla Public Suffix List format file from the Reader `source`.
The optional `opts` map supports:
- `:sections` - a set drawn from `#{:icann :private}` selecting which
sections of the list to include. The PSL is partitioned by the
`// ===BEGIN ICANN DOMAINS===` and `// ===BEGIN PRIVATE DOMAINS===` marker
comments; pass `#{:icann}` to ignore the user-contributed PRIVATE section.
Defaults to both sections (the historical behavior).(lookup dom)(lookup psl dom)Determine the E2LD of domain as specified by the PSL loaded in psl.
Uses the default PSL loaded from *default-psl-url* if psl is not provided.
Returns nil if the domain does not match the provided PSL.
Determine the E2LD of `domain` as specified by the PSL loaded in `psl`. Uses the default PSL loaded from `*default-psl-url*` if `psl` is not provided. Returns `nil` if the domain does not match the provided PSL.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |