Skip to content

Crawler sends Accept-Language en-US by default; locale redirects make /de-ch and /fr-ch duplicates of /en #1355

Closed

Description

@deniskern

Observed

squirrel 0.0.138 (Overhub runner, Hetzner DE) audits https://www.alpensattel.de (Shopify, Markets with locale paths /de-ch, /fr-ch, /en). content/duplicate-description reports one English description on /de-ch, /fr-ch and /en. Live, /de-ch serves German (lang=de) and /fr-ch French.

pages rows in project.db for the crawl:

url final_url request accept-language
https://www.alpensattel.de/de-ch https://www.alpensattel.de/en en-US,en;q=0.9
https://www.alpensattel.de/fr-ch https://www.alpensattel.de/en en-US,en;q=0.9

Reproduction from the same host (plain curl, same UA):

accept-language: en-US,en;q=0.9  /de-ch -> https://www.alpensattel.de/en
accept-language: de-DE           /de-ch -> https://www.alpensattel.de/
no accept-language               /de-ch -> https://www.alpensattel.de/de-ch (German)

Expected

  1. The crawler fetches pages the way search engines do: Googlebot sends no Accept-Language, so locale redirects keyed on it do not fire. A fixed en-US default makes every locale path of a shop with language redirection collapse into /en.
  2. When final_url differs from url (redirect to another page), content rules (duplicate-description, duplicate-title, …) evaluate the final URL once, not the requested URL as a separate page with the target's content.

Proposal

  • Drop the default Accept-Language header (or make it configurable to "none"); [crawler] headers can only override it with another value.
  • Dedupe pages by final_url before content duplicate rules, or attribute redirected content to the final URL.

Acceptance Criteria

  • A default crawl sends no Accept-Language header (the crawler fetches the way a search-engine bot does), so locale redirects keyed on that header do not fire; a regression test asserts the request headers
  • [crawler] headers can still set an explicit Accept-Language, and the docs say what the default is and how to set one
  • When a page's final_url differs from its url, content duplicate rules (duplicate-description, duplicate-title) evaluate the final URL once; the requested URL is not counted as a separate page carrying the target's content
  • A fixture with /de-ch and /fr-ch redirecting to /en only when Accept-Language is present audits as three distinct pages with no duplicate-description finding, and /de-ch redirecting to /en regardless is reported once
  • Cloud rendering (browser) requests keep working with no default Accept-Language, and any change in behaviour is documented

Activity

  1. added
    bug
    size: M
    on Oct 30, 2026
  2. added theissue type on Oct 30, 2026
  3. nc9 commented on Oct 30, 2026

    @nc9
    Contributor

    Thanks for the detailed report and the curl repro. Triaged: a default Accept-Language that triggers locale redirects, plus content duplicate rules counting a redirected URL as its own page, are both worth fixing. Acceptance criteria added to the issue body; we will pick it up shortly.

    nik

  4. nc9 commented on Oct 30, 2026

    @nc9
    Contributor

    Verified against main after v0.0.145. Met: criteria 1 to 4 (no default Accept-Language, a configured header still works and is documented, redirected pages are counted once, and the e2e fixture covers both). Open: criterion 5 (cloud rendering): the docs state that a browser render uses its own language while the plain fetch sends none, but no test covers the render path without a default header. Leaving this open for that test.

    nik

  5. nc9 commented on Oct 31, 2026

    @nc9
    Contributor

    Re-checked against main after v0.0.147. Criteria 1 to 4 stay met. Open: criterion 5 (cloud rendering): the docs state that a browser render uses its own language while the plain fetch sends none, but no test covers the render path without a default header and the hosted behaviour cannot be verified from this repo. Leaving this open for that.

    nik

  6. nc9 commented on Oct 31, 2026

    @nc9
    Contributor

    Re-checked against main after v0.0.148 (a test now shows the cloud render request carries no Accept-Language). Criteria 1 to 4 stay met. Open: criterion 5: the client side is covered and documented, but what the hosted browser does cannot be verified from this repo, and a code comment in the test (a configured header cannot reach the render) disagrees with the dashboard docs (custom headers go to the cloud browser); those two need reconciling. Leaving this open for that.

    nik

  7. nc9 commented on Nov 2, 2026

    @nc9
    Contributor

    Verified on main (e86767ff). No default Accept-Language: packages/crawler/src/fetcher.ts (comment and no header set) and packages/crawler/src/core/crawler.ts (a configured one passes through). The last box: cloud-fetcher.test.ts passes 13/13, including the test that the render submit carries only urls and timeoutMs and no Accept-Language, with a plain and a configured fetch both returning 200. docs/configuration/crawler.mdx states the default and the render behaviour. The mismatch I flagged earlier (test comment versus dashboard docs) is reconciled in 014e196b: the comment and the docs now describe two different paths, the CLI render (no headers reach it) and the dashboard audit (website custom headers reach the cloud browser). What the hosted browser does is still not verifiable from this repo, and the docs say so. Fix commits: a44a6993, db6254ab, 830028d7. All boxes ticked, closing.

    nik

  8. nc9 commented on Nov 2, 2026

    @nc9
    Contributor

    Checked against main (e86767f). Ticked criterion 5; all five criteria are met. The fix landed in v0.0.145 (a44a699, db6254a), v0.0.148 (830028d) and v0.0.154 (014e196). Criterion 5: packages/audit-engine/tests/cloud-fetcher.test.ts asserts a plain and a configured fetch both return 200 and that every render submit has exactly the keys timeoutMs and urls, with no Accept-Language; its comment and docs/configuration/crawler.mdx now say the same thing (the CLI render request has no header field; custom headers of a website in the dashboard reach the cloud browser on the hosted path, see docs/dashboard/crawl-settings.mdx and docs/cloud/firewall.mdx). What the hosted browser does itself is not verifiable from this repository. Tests run and passing: cloud-fetcher with rate-limited-coverage (20), audit-accept-language-1355-e2e (3), redirected-pages-not-duplicates-1355 (12). Closing. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.154

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclisize: M

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions