mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #337] [MERGED] Support allowedDevOrigins separately from serverActions.allowedOrigins #489
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#489
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/337
Author: @JaredStowell
Created: 3/8/2026
Status: ✅ Merged
Merged: 3/8/2026
Merged by: @james-elicx
Base:
main← Head:jstowell/fix-allowedDevOrigins📝 Commits (2)
632cdcfFix and fully implement allowedDevOriginsf3a5fbbMerge branch 'main' into jstowell/fix-allowedDevOrigins📊 Changes
8 files changed (+189 additions, -6 deletions)
View changed files
📝
packages/vinext/src/check.ts(+2 -1)📝
packages/vinext/src/config/next-config.ts(+10 -0)📝
packages/vinext/src/index.ts(+3 -3)📝
packages/vinext/src/server/app-dev-server.ts(+1 -1)📝
tests/app-router.test.ts(+65 -1)📝
tests/check.test.ts(+12 -0)📝
tests/pages-router.test.ts(+54 -0)📝
tests/shims.test.ts(+42 -0)📄 Description
Summary
Parse and wire
allowedDevOriginsas its own config surface instead of reusingexperimental.serverActions.allowedOrigins.This fixes the dev-origin enforcement so the dev server allowlist does not widen or narrow trust boundaries based on server action CSRF config.
Changes
allowedDevOriginstoNextConfigandResolvedNextConfigallowedDevOriginsinresolveNextConfig()allowedDevOriginsfor Pages Router dev-origin checksallowedDevOriginsinto the App Router virtual RSC entryexperimental.serverActions.allowedOriginsvinext checkto reportallowedDevOriginsas supportedTests
allowedDevOriginsdefaults and separation fromserverActions.allowedOriginstest/development/basic/allowed-dev-origins.test.tsallowedDevOriginsandallowedOriginsremain distinctvinext checkcoverage forallowedDevOriginsVerification
pnpm test tests/check.test.ts -t "allowedDevOrigins|experimental.serverActions|next.config"pnpm test tests/shims.test.ts -t "allowedDevOrigins|serverActionsAllowedOrigins"pnpm test tests/app-router.test.ts -t "loads allowedDevOrigins from next.config into the virtual RSC entry|keeps allowedDevOrigins separate from allowedOrigins|embeds allowedDevOrigins"pnpm test tests/pages-router.test.ts -t "Pages Router allowedDevOrigins config"pnpm test tests/dev-origin-check.test.ts🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.