{{ message }}
Repository navigation
fix: rewrite redirect targets and preserve recursive crawling - #878
Merged
Merged
Conversation
JustinBeckwith
marked this pull request as ready for review
August 17, 2026 04:35
JustinBeckwith
force-pushed
the
codex/fix-redirect-rewrites-and-crawling
branch
from
August 17, 2026 04:41
143b944 to
c2278e8
Compare
JustinBeckwith
force-pushed
the
codex/fix-redirect-rewrites-and-crawling
branch
from
August 17, 2026 04:46
0291161 to
472cdac
Compare
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.

Summary
urlRewriteExpressionsfrom JSON and JavaScript config files in the CLIRoot cause
URL rewrites were only applied when a URL first entered
crawl(). Redirect targets were followed insidemakeRequest()without passing through the rewrite pipeline, so rewritten destinations could still hit the original host.Manual redirect handling also relied on the fetch response's URL metadata for the effective destination. Tracking the final URL explicitly makes recursive parsing deterministic and ensures relative links discovered on the redirect destination use the correct base URL.
User impact
Redirected URLs now behave consistently with directly discovered URLs: rewrites run at every hop, skip rules see the rewritten destination, sensitive headers remain protected across origin changes, and destination documents continue to contribute recursively discovered links.
The maintainability review also reduced
src/index.tsby 187 lines relative tomainand kept redirect rewrite coverage out of the existing redirect test file, which would otherwise have crossed 1,000 lines.Fixes #877.
Fixes #875.
Validation
npm run buildnpm test -- --run— 259 tests passednpm run coverage— 94.03% statements, 89.06% branches, 98% functionsnpm run lintnpm run docs-test— 17 links passednpm pack --dry-run --jsonnpm run build-binaries--versionsmoke tests