Repository navigation
Conversation
…not duplicates of their target #1355 Signed-off-by: Nik Cubrilovic <[email protected]>
…arget is crawled; docs and changelog state the cache, fingerprint and render caveats #1355 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/1355-accept-language-redirect-dups
branch
from
October 30, 2026 19:29
ae89f65 to
26df5c2
Compare
Contributor
Author
|
Landed in v0.0.145 as nik |
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 #1355
What
Accept-Language. The page fetcher (standard and browser-header paths), the CLI request tool, robots.txt, sitemap and redirect-chain fetches no longer adden-US,en;q=0.9. A value in[crawler] headersstill goes through unchanged (custom headers are merged over the defaults). The cache request context used to carry the fixeden-USvalue; it now carries a configuredAccept-Languageonly. The cache matches onVaryfield names, so only pages served withVary: Accept-Languageare refetched; a site that redirected by language withoutVarykeeps its cached redirect until--refresh(said in the CHANGELOG and docs).redirectedAway(url, finalUrl, crawled)andcrawledPageKeysin@squirrelscan/utils/url: both sides go through the samenormalizePageUrl(case, default port, fragment, trailing slash), and a requested URL is skipped only when its final URL is itself a page of the crawl. If the target was never crawled (nothing links to it, including a query-only redirect), the requested row is the only copy of that content and is evaluated, so a real duplicate is not hidden. The streaming engine builds the crawled set from one light pass overgetPagesWithoutBodiesandextractPageFeaturesblanks title and description only for such rows; the legacy loops ofcontent/duplicate-title,content/duplicate-descriptionandcore/title-uniquedo the same.docs/configuration/crawler.mdx(headers: the default, how to set one, the duplicate behaviour). CHANGELOG under Unreleased (Changed and Fixed).Tests (failing first)
apps/cli/tests/cli/audit-accept-language-1355-e2e.test.ts: real CLI against a shop-like server whose/de-chand/fr-chredirect to/enonly when the request hasAccept-Language. Default: no request carries it, the locale paths are crawled as their own pages, no duplicate-title or duplicate-description finding. With[crawler] headers = { "Accept-Language" = "en-US" }: every crawl request to/de-ch,/fr-ch,/encarries it, and the three redirecting URLs are not duplicates of/en. Both fail on main.packages/rules/tests/redirected-pages-not-duplicates-1355.test.ts: the helper (canonicalisation both sides, uncrawled target, query-only redirect), and the three rules (redirected urls to a crawled target are not duplicates; two real pages with the same text still are; a redirect to an uncrawled target does not hide a duplicate)./a2redirects to a never-linked/b2and/c2repeats its text: the duplicate is reported (fails on the first version of this PR).page-features-noindex-golden;make validate.Hosted audits
The cloud crawler uses
packages/crawler, so it inherits the change when the private gitlink is bumped; cloud browser renders use the browser's own language and are unaffected. The privateapps/link-check-worker(check-url.ts,perch_tier2/fetch.py) has its ownAccept-Language: en-US,en;q=0.9for link status checks: that is a separate fetcher, so a small private follow-up should decide whether it drops the header too. Cached prior-crawl entries inpackages/cloud-audit-runtimethat were keyed onaccept-language: enwill simply miss once.Skill (
squirrelscan/skills): no change needed.Docs also say: the browser User-Agent now arrives with no language (a strict bot filter may notice), and a cloud browser render uses the browser's language while the plain fetch beside it sends none. Rebased on main.