mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #473] [MERGED] test: headers() and cookies() in server actions and route handlers #597
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#597
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/473
Author: @james-elicx
Created: 3/11/2026
Status: ✅ Merged
Merged: 3/11/2026
Merged by: @james-elicx
Base:
main← Head:test/headers-cookies-in-server-actions📝 Commits (3)
127491ftest: add regression tests for headers() and cookies() in server actions and route handlers2f21e99test: address review comments on action-headers tests7d649c2test: address second round of review comments📊 Changes
4 files changed (+301 additions, -0 deletions)
View changed files
➕
tests/fixtures/app-basic/app/nextjs-compat/action-headers/actions.ts(+20 -0)➕
tests/fixtures/app-basic/app/nextjs-compat/action-headers/page.tsx(+37 -0)➕
tests/fixtures/app-basic/app/nextjs-compat/api/headers-in-route/route.ts(+16 -0)➕
tests/nextjs-compat/action-headers.test.ts(+228 -0)📄 Description
Summary
headers()andcookies()work correctly inside server actions (both wrapper form actions and named exports)headers()+cookies()work together in the same handlername="$ACTION_ID_<module>#<export>") for future test authorsNew files
tests/nextjs-compat/action-headers.test.tstests/fixtures/app-basic/app/nextjs-compat/action-headers/actions.ts"use server"module withgetHeaderFromActionandgetCookieFromActionnamed exportstests/fixtures/app-basic/app/nextjs-compat/action-headers/page.tsx$ACTION_ID_*hidden inputstests/fixtures/app-basic/app/nextjs-compat/api/headers-in-route/route.tsheaders()andcookies()simultaneouslyTest coverage
headers()does not throw in a server actioncookies()does not throw in a server actiongetHeaderFromAction("x-test-header")returns the correct header valuegetCookieFromAction("test-cookie")returns the correct cookie valueheaders()andcookies()both work together in a route handler🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.