Remove dead permanent key from redirect entries - #1857
Open
marcleblanc2 wants to merge 1 commit into
Open
Conversation
Follow-up to 7a81737 (#1430), which deleted the commented-out next.config.js redirects() block. Since 578a3ae (#880) redirects are served by src/middleware.ts, which only reads source and destination and always responds 307, so permanent has been unused for ~19 months. Five entries had it misspelled as permanant, which nothing caught because nothing reads it. Amp-Thread-ID: https://ampcode.com/threads/T-01a07558-075c-743f-b255-c080ca6b5cc7 Co-authored-by: Amp <amp@ampcode.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
permanent key from redirect entries
marcleblanc2
enabled auto-merge (squash)
September 6, 2026 06:41
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.
Follow-up to 7a81737 (#1430), which deleted the commented-out
redirects()block fromnext.config.js.Why
permanenton redirect entries has been dead data since 578a3ae (#880, Jan 2025) moved redirects intosrc/middleware.ts. The middleware only readssourceanddestination, and callsNextResponse.redirect()with no status, so every redirect is a 307 regardless of the field:The field was only functional while Next's built-in
redirects()consumed the list (cfeed16, Dec 2023 → 578a3ae, Jan 2025). Nothing has read it since, which is why five entries added in #1620 with the key misspelled aspermanantwent unnoticed.What
permanent/permanantfrom all 1325 entries insrc/data/redirects.tspermanent: redirect.permanentpass-through inupdatedRedirectsDataVerification
rg -o "^\t\t\w+:" src/data/redirects.ts | sort | uniq -c→ 1325source, 1325destination, nothing elsenpx tsc --noEmitreports no errors inredirects.tsormiddleware.ts(the remaining errors are the pre-existing missingcontentlayer/generatedbuild output)prettier --checkonredirects.tsfails the same way it does onmain(line-join nits at exactly 80 chars); left as-is to avoid unrelated churnIf we ever want 308s back, the fix is in
middleware.ts(pass a status toNextResponse.redirect), and at that point the key can be reintroduced with the entries that actually need it.