Repository navigation
redirects: remove 222 rules that can never match - #2035
Draft
marcleblanc2 wants to merge 1 commit into
Draft
marcleblanc2 wants to merge 1 commit into
marcleblanc2 wants to merge 1 commit into
Conversation
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).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
This branch was successfully deployed
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.
Second dead-rule cleanup after #1966. Zero behaviour change.
src/proxy.tsmatches 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:Plus 1 shadowed rule: a second
/admin/http_https_configurationentry, 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=patienceshows deletions only (1,086 lines). File parses to 741 rules (963 − 222).Untouched on purpose:
.mdand/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.