fix: support cookie v2.x#387
Merged
Merged
Conversation
e45a568 to
8027bc5
Compare
v2 dropped the export in favour of , breaking the header built from in inject() with . - adapt lib/request.js to the new cookie@2 API - bump the dependency to ^2.0.1
8027bc5 to
e0a4731
Compare
metcoder95
approved these changes
Jul 9, 2026
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.
Proposal:
light-my-requestto work withcookie v2.x(v2.0.0: https://github.com/jshttp/cookie/releases/tag/v2.0.0)Change
cookiev2 removed theserialize(name, value, opts)export, replacing it withstringifySetCookie({ name, value, ...opts }).lib/request.jsstill calledcookie.serialize(...)to build theCookieheader fromoptions.cookies, so any inject() call passingcookiesthrewcookie.serialize is not a function(500/TypeError).Notes for reviewers
cookie.serialize/.parsewere never part of this package's public API, so no back-compat wrapper was needed (unlike in @fastify/cookie).cookie's API directly, so no doc changes.