Repository navigation
fix(crawler): pages stored under absolute URLs; relative sitemap loc resolved and reported #1274 - #1295
Closed
nc9 wants to merge 1 commit into
Closed
fix(crawler): pages stored under absolute URLs; relative sitemap loc resolved and reported #1274#1295nc9 wants to merge 1 commit into
nc9 wants to merge 1 commit into
Conversation
…<loc> resolved and reported #1274 Signed-off-by: Nik Cubrilovic <[email protected]>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1274
What
Root cause: the crawler stored
page.url = entry.rawUrl, the URL as discovered. A relative sitemap<loc>/pricing</loc>was enqueued fine (the frontier resolves it against the base for fetching), but the page record kept the raw/pricing, sonew URL(ctx.page.url)threw inurl/length,url/parameters,url/slug-keywords,url/trailing-slash,crawl/paginationandschema/website-searchon every page.enqueueUrl(packages/crawler/src/core/crawler.ts) now stores the absolute URL, resolved against the crawl base exactly asnormalizeUrlalready did, so no discovery source (sitemap, link, carried, seed) can put a path into a page record.parseSitemapresolves a relative<loc>(urlset or index child) against the sitemap's own URL, so sitemap-coverage matching sees the page it names, and records one error per sitemap listing the offending entries ("N values are not an absolute URL ...").crawl/sitemap-validalready surfacessitemap.errors, so the protocol problem is reported there with the entries listed, no new rule or check.Sitemap:line in robots.txt was already resolved (Seed redirect probe and cache Vary key should use the custom User-Agent header when one is set #2316); unchanged.Tests (failing first)
packages/crawler/tests/relative-urls-1274.test.ts: parseSitemap resolves and reports relative locs (urlset and index) and stays silent for absolute ones; a real crawl of a Bun.serve fixture with a relative-loc sitemap and a scheme-less link stores only absolute, parseable page URLs. 3 of 4 failed on main.Built CLI (
squirrel auditon a fixture withSitemap: /sitemap.xmland<loc>/</loc>,--offline --passive): 15Rule error: Invalid URLfails on main, 0 after;crawl/sitemap-validlists/, /pricing.Not covered
https://example.com/other-host.azurewebsites.net/apps/x) is already a valid absolute URL after resolution; the same admission fix covers any raw form that failed.squirrelscan/skills): no change needed. No docs change (no new check or reason).## [Unreleased]/ Fixed.