Skip to content

fix(vercel): mark header-only route entries as continue - #4652

Merged
pi0 merged 4 commits into
mainfrom
vercel-headers-continue-main
Sep 22, 2026
Merged

pi0 merged 4 commits into
mainfrom
vercel-headers-continue-main

Conversation

@danielroe

@danielroe danielroe commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

port of #4651 to main

currently setting a headers route rule means we clobber any other rules, e.g. caching rules, and always fall to a function

discovered while debugging an issue with @larbish and @atinux

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe
danielroe requested a review from pi0 as a code owner September 22, 2026 10:46
@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
nitro.build Ready Ready Preview Sep 22, 2026 7:52pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8382798a-ff5d-46dd-860b-3852ace5129c

📥 Commits

Reviewing files that changed from the base of the PR and between 1e42875 and 2c1e248.

📒 Files selected for processing (2)
  • src/presets/vercel/utils.ts
  • test/presets/vercel.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Vercel header-only routes now omit continue: true when redirect: false. Tests verify that the route keeps its headers and appears before the less-specific redirect route.

Vercel route continuation

Layer / File(s) Summary
Conditional header route continuation
src/presets/vercel/utils.ts
generateBuildConfig omits continue: true for header-only routes with redirect: false.
Generated route ordering validation
test/presets/vercel.test.ts
The fixture, snapshot, and test validate the preserved header, route ordering, and omitted continue property.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 2c1e2

The PR is mergeable with no concrete unresolved risk identified in the reviewed scope.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits format with the fix(vercel): prefix and describes the header-only route behavior changed by the pull request.
Description check ✅ Passed The description clearly identifies the Vercel header-rule bug, its effect on other route rules, and the purpose of the fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nitro@4652

commit: 2c1e248

Emit header-only routes least specific first so the more specific rule overrides, matching runtime route rule merging.
prevents less specific redirect rules from matching via `continue`
@pi0x

pi0x commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

On top of the first commit: 1e42875 orders header-only routes from least to most specific so the more specific rule wins under continue, and 2c1e248 drops continue for header rules with redirect: false so a broader redirect (e.g. /foo/**) no longer redirects them at the edge. Verified with a real Vercel deployment against main: public asset immutable caching now works, header precedence is correct, and ISR/CDN caching is unchanged.

Written with AI assistance.

@pi0
pi0 merged commit ded59be into main Sep 22, 2026
14 of 15 checks passed
@pi0
pi0 deleted the vercel-headers-continue-main branch September 22, 2026 20:07

This branch was successfully deployed

1 active deployment
Preview — 2c1e248c Deployed Sep 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants