We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instead of res.setHeader, fastify uses reply.header("Content-Type", "application/json; charset=utf-8")
res.setHeader
reply.header("Content-Type", "application/json; charset=utf-8")
http://expressjs.com/en/4x/api.html#res.set https://www.fastify.io/docs/latest/Reference/Reply/#headerkey-value
Please make setting headers compatible with fastify too. Instead of this line
cookies/index.js
Line 115 in 7d6ac60
var setHeader = null if (typeof res.set == 'function') { setHeader = http.OutgoingMessage.prototype.setHeader } else if (typeof res.setHeader == 'function') { setHeader = res.setHeader } else if (typeof res.header == 'function') { //fastify res.header('Set-Cookie', headers) return this } setHeader.call(res, 'Set-Cookie', headers) return this
The text was updated successfully, but these errors were encountered:
Hello, sorry you are having trouble. It seems like you are just passing in the wrong object for Fastify
https://github.com/pillarjs/cookies#new-cookiesrequest-response--options
The request argument is a Node.js HTTP incoming request object and the response argument is a Node.js HTTP server response object.
So for Fastify, this should be cookies = new Cookies(req.raw, reply.raw). I hope this helps!
cookies = new Cookies(req.raw, reply.raw)
Sorry, something went wrong.
Thank you, Doug! That helps!
No branches or pull requests
Instead of
res.setHeader
, fastify usesreply.header("Content-Type", "application/json; charset=utf-8")
http://expressjs.com/en/4x/api.html#res.set
https://www.fastify.io/docs/latest/Reference/Reply/#headerkey-value
Please make setting headers compatible with fastify too.
Instead of this line
cookies/index.js
Line 115 in 7d6ac60
use
The text was updated successfully, but these errors were encountered: