Skip to content

Conversation

@ikreymer
Copy link
Member

@ikreymer ikreymer commented Jan 29, 2026

Refactor dispatcher apis:

  • Use getProxyDispatcher(withRedirect = true) to follow redirects by default, with option to disable (eg. in recorder). This dispatcher also ignores TLS errors, to match current browser config. Used for fetching archival content.
  • Use getFollowRedirectsDispatcher() with follows redirects but does not ignore TLS and does not use proxies, for fetching non-archival configs (profiles, behaviors, etc...)

Fixes #954, regression from #946

Testing:

  • run crawler on a seed that redirects, ex:
    docker run --rm webrecorder/browsertrix-crawler crawl --url https://eff.org/ --useSitemap --logging debug --context sitemap
  • without this PR, will see errors like: "Not loading sitemap: invalid status code","details":{"status":301}}
  • with this PR, the redirect should be followed and sitemap loaded correctly.

…verted from fetch()

- add a redirect interceptor to getProxyDispatcher(), with option to disable
- add getDefaultDispatcher() for defaulting to follow redirects
- fixes #954
@ikreymer ikreymer requested a review from tw4l January 29, 2026 00:03
- getProxyDispatcher(withRedirect: boolean) used for all archival content fetching, ignores TLS errors (to match browser config), and can follow redirects
- getFollowRedirectDispatcher() use for other fetches where following redirects is needed, but TLS certs should be verified (eg. behaviors files, profile loading)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default to following redirects for most fetches

2 participants