mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #554] [MERGED] fix: add ResponseCookies.has() shim #669
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#669
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/554
Author: @NathanDrake2406
Created: 3/16/2026
Status: ✅ Merged
Merged: 3/16/2026
Merged by: @james-elicx
Base:
main← Head:fix/response-cookies-has📝 Commits (1)
7c017f5Add ResponseCookies.has()📊 Changes
2 files changed (+15 additions, -0 deletions)
View changed files
📝
packages/vinext/src/shims/server.ts(+4 -0)📝
tests/shims.test.ts(+11 -0)📄 Description
Summary
This adds the missing
ResponseCookies.has(name)method to thenext/servershim and covers it with a regression test.What Changed
ResponseCookies.has(name)inpackages/vinext/src/shims/server.tsResponseCookiesAPI test intests/shims.test.tsWhy It Matters
RequestCookiesalready exposedhas(), and Next.js documentsNextResponse.cookies.has(name)as part of the public API. Without this method, middleware code likeresponse.cookies.has("session")throws at runtime instead of returning a boolean.Risks Or Limits
This is a small shim-surface change.
has()delegates toget(), so it inherits the existing response-cookie parsing behavior rather than introducing a second code path.Verification
./node_modules/.bin/vp test run tests/shims.test.ts -t "response cookie exists"./node_modules/.bin/vp test run tests/shims.test.ts -t "ResponseCookies API|response cookie exists"git diff --check🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.