mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 00:09:23 +02:00
[PR #802] [MERGED] fix: validate RequestCookies names before mutating Cookie header #856
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#856
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/802
Author: @southpolesteve
Created: 4/9/2026
Status: ✅ Merged
Merged: 4/9/2026
Merged by: @southpolesteve
Base:
main← Head:fix/validate-next-server-request-cookie-names📝 Commits (1)
b487620fix: validate RequestCookies names before mutating Cookie header📊 Changes
2 files changed (+34 additions, -1 deletions)
View changed files
📝
packages/vinext/src/shims/server.ts(+6 -1)📝
tests/shims.test.ts(+28 -0)📄 Description
Summary
Add cookie-name validation to
next/server'sRequestCookiesAPI before mutating the rawCookierequest header.Details
RequestCookies.set()anddelete()inpackages/vinext/src/shims/server.tsrewrite the incomingCookierequest header. Unlike thenext/headerscookie shim andResponseCookies, this code path did not validate cookie names before serializing them back into the header.This change adds
validateCookieName()checks to:RequestCookies.set(name, value)RequestCookies.set({ name, value })RequestCookies.delete(name)RequestCookies.delete([name1, name2, ...])Tests
Adds focused direct tests against the
next/serverRequestCookiesAPI covering:=;set({ name, value })delete([...])🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.