You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(crawl): the WASM crawl loop still sends credentials to any host it follows #404
PR #403 scopes configured credentials to the crawl's seed host on the main crawl loop, but the sequential/WASM loop cannot receive that override, so it keeps the defect #387 describes.
crates/crawlberg/src/engine/wasm_crawl.rs:259 calls the public scrape() once per frontier entry:
matchself.scrape(&entry.url).await{
scrape() derives the origin host from the URL it is given, so a frontier entry on a different host — a subdomain admitted by allow_subdomains, or a redirect target — is its own origin by construction and gets the credentials. That is the same self-referential check #403 removed from crawl_loop.rs, still in place here. batch_scrape (:447) has the same shape, though its inputs are caller-supplied rather than discovered, so it is the less severe half.
The fix needs an internal scrape() variant that accepts an explicit origin_host: Option<&str>, threaded through the browser-mode branches the same way #403 threads it through http_fetch/fetch_with_retry. It is testable without a browser: the module compiles under cfg(test) on native and already has tests in that file.
Also still deriving their own origin (pre-existing, not named in #387, listed here so the remaining surface is in one place): asset downloads in assets.rs, and the sitemap/map fetches in sitemap.rs and map.rs.
Fixed on integration/0927 by #495 (c9d8254): the sequential crawl loop, which the WASM build uses, now scrapes every page under the seed's credential scope, so subdomain and cross-host pages no longer receive the seed's auth or custom headers. Independent review ACCEPT at the landed head; union gate green (1926 passed, 0 failed); putting the old per-page call back turns four tests red.
Activity
test(crawl): cover custom headers, seed-URL credentials and the scrap…
fix(crawl): keep the seed's credential scope for every page of a sequ…
tobocop2 commentedon Sep 29, 2026
Fixed on integration/0927 by #495 (c9d8254): the sequential crawl loop, which the WASM build uses, now scrapes every page under the seed's credential scope, so subdomain and cross-host pages no longer receive the seed's auth or custom headers. Independent review ACCEPT at the landed head; union gate green (1926 passed, 0 failed); putting the old per-page call back turns four tests red.