镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

redirects: remove 222 rules that can never match - #2035

Draft
marcleblanc2 wants to merge 1 commit into
mainfrom
marc/redirects/batch-2
Draft

marcleblanc2 wants to merge 1 commit into
mainfrom
marc/redirects/batch-2

Conversation

@marcleblanc2

Copy link
Copy Markdown
Contributor

Second dead-rule cleanup after #1966. Zero behaviour change.

src/proxy.ts matches the request path against rule sources with exact, first-match equality. Browsers never send #fragment, so a rule whose source has one is only ever consulted for its bare path. That makes 221 of them moot:

  • 202 whose bare path already has its own rule (that rule fires, always has)
  • 19 whose bare path is a live page (the page is served, the rule is never consulted)

Plus 1 shadowed rule: a second /admin/http_https_configuration entry, beaten by the one at the top of the file and pointing at a misspelled page.

Proof: for every path a browser can send, the first matching rule and its destination are identical before and after (732 paths, 0 changed). git diff --diff-algorithm=patience shows deletions only (1,086 lines). File parses to 741 rules (963 − 222).

Untouched on purpose: .md and /docs/-prefixed sources (see the batch 3 PR) and rules that fire but land on a 404 (batch 4 PR). Independent of both; if either merges first this may need a trivial rebase.

The proxy matches a request path against rule sources with exact,
first-match equality, and browsers never send #fragments. So a rule
whose source has a #fragment can only ever be consulted for its bare
path, and 221 of them are moot: the bare path already has its own rule
(202) or is a live page (19). The other rule is a second
/admin/http_https_configuration entry shadowed by the one at the top of
the file, pointing at a misspelled page.

For every path a browser can send, the first matching rule and its
destination are unchanged (732 paths before and after).
@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 25, 2026 1:51am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

This branch was successfully deployed

1 active deployment
Preview — 285cbc47 Deployed Sep 25, 2026 by vercel[bot]
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.

1 participant