Component evidence
Normalizes, canonicalizes, and compares URLs for crawler deduplication, including query sorting, hostname handling, and URL template detection.
// Source: https://github.com/every-app/open-seo | License: MIT | Copyright 2026 Ben Senescu // Provided via justclaw.it.com; keep this notice with the code. /** * URL normalization and utility functions for the site audit crawler. */ /** * Normalize a URL for deduplication: * - Resolve relative URLs against a base * - Strip fragments (#...) * - Sort query parameters * - Lowercase the hostname * - Preserve trailing slashes. A trailing slash is the canonical form on most * CMS platforms (WordPress etc.), which 301-redirect the non-slash version to * it. Stripping it here would rewrite the canonical URL into its own redirect * source, so the crawler would follow /path -> /path/ and strip back to /path * forever — a 508 loop. Keeping /path and /path/ distinct lets the red ... (truncated -- full source via MCP)