Skip to main content

Module canonical

Module canonical 

Source
Expand description

URL canonicalization for LinkMarks.

The full ruleset lives in this module’s doc-comment on canonicalize.

Determinism: given the same input URL, canonicalize returns the same output bytes across runs, platforms, and processes. This is the dedupe key and must be stable.

Enums§

CanonicalizeError
Error returned when a URL cannot be canonicalized.

Constants§

TRACKING_PARAMS
Tracking-parameter blocklist. Lowercased. Matched as a prefix for utm_* and mc_*, and as an exact match for the rest.

Functions§

canonicalize
Canonicalize a URL string.
canonicalize_for_core
Convenience wrapper: canonicalize and map errors into CoreError.
canonicalize_with
Canonicalize using explicit per-domain preservation rules.
is_tracking
Returns true if the given (lowercased) query parameter name is a known tracking parameter.