mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #517] [MERGED] fix: add missing set/delete/clear/size/toString to RequestCookies #639
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#639
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/517
Author: @NathanDrake2406
Created: 3/13/2026
Status: ✅ Merged
Merged: 3/13/2026
Merged by: @james-elicx
Base:
main← Head:fix/request-cookies-set-delete📝 Commits (2)
b5f6fddfix: add missing set/delete/clear/size/toString to RequestCookiesd1dae48refactor: DRY up RequestCookies clear/toString/syncHeader📊 Changes
2 files changed (+225 additions, -7 deletions)
View changed files
📝
packages/vinext/src/shims/server.ts(+57 -7)📝
tests/shims.test.ts(+168 -0)📄 Description
Summary
RequestCookiesclass inserver.ts(used byNextRequest.cookiesin middleware) was missingset(),delete(),clear(),size, andtoString()methods that@edge-runtime/cookiesprovidescookies.set()orcookies.delete()to forward modified cookies downstream would fail at runtimeCookieheader on every method callencodeURIComponentwhen syncing back to theCookieheader, preventing round-trip data corruptiondelete()acceptsstring | string[]and returnsboolean | boolean[]matching@edge-runtime/cookiesTest plan
RequestCookies APIdescribe block covering:set()— add, overwrite, object form, chainingdelete()— single name, array of names, return value (boolean/boolean[]), no-op for missingclear()— removes all cookies and clears headersize— count, emptytoString()— serialization;,=,%)set()thendelete()interaction🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.