Repository navigation
Let Server Actions through the live preview in next dev - #14
Merged
Merged
Conversation
Behind orun.work's live Preview the browser's Origin is the preview's host
while `next dev` sees Host 127.0.0.1:3000, and Next refuses a Server Action
from an origin that is not the Host ("Invalid Server Actions request").
allowedDevOrigins (baseline-v7) covers the hot reload, not this.
- apps/web/next.config.ts: inside `experimental`, the preview's hosts
(*.orun-preview.app, preview-gateway-stage.oruncloud.workers.dev) as
serverActions.allowedOrigins, only when NODE_ENV is development
(`next dev`). `next build` runs with NODE_ENV=production, so the
deployed Worker keeps its same-origin check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019PcpNV6SjymJBPv3nNkC4z
ruehowl
marked this pull request as ready for review
November 4, 2026 21:14
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.
What
A follow-up to #13 (baseline-v7, the site's live preview), from the same rollout (saas-parallel-baselining PB4).
Behind orun.work's live Preview, the browser's
Originis the preview's host whilenext devseesHost: 127.0.0.1:3000, and Next refuses a Server Action from an origin that is not the Host ("Invalid Server Actions request", a 500 on the POST).allowedDevOrigins(#13) covers the hot reload and/_next/*, not Server Actions. Every Next baseline gets this allow-list, whether or not it has Server Actions today, so a session that adds a form does not break its preview.apps/web/next.config.ts, insideexperimental:next buildruns withNODE_ENV=production, so the deployed Worker keeps its same-origin check.Nothing about how the site builds or deploys changes.
Checked
From a clean clone, with orun v2.96.0, through the local stand-in of the preview gateway:
orun preview start --jsonreadyin 9.6 s;next devlistsserverActionsunder its experimentsGET /app/page.tsxhot-updated in 0.5 sorun preview stopThe allow-list itself was checked against the running
next devof other Next 16.3 baselines that have Server Actions (sourceplane/subscription-payments, sourceplane/nl-postgres), POSTing an action with eachOrigin:https://abc123def456.orun-preview.appand the stage gateway host pass Next's origin check (404, action not found),https://elsewhere.example.comis refused (500, "Invalid Server Actions request"). This site has no Server Actions yet, so Next answers any action POST "not found" before that check.Generated by Claude Code