Socket
Socket
Sign inDemoInstall

@fastify/cookie

Package Overview
Dependencies
Maintainers
19
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/cookie - npm Package Compare versions

Comparing version 9.0.3 to 9.0.4

2

package.json
{
"name": "@fastify/cookie",
"version": "9.0.3",
"version": "9.0.4",
"description": "Plugin for fastify to add support for cookies",

@@ -5,0 +5,0 @@ "main": "plugin.js",

@@ -105,2 +105,7 @@ 'use strict'

function fastifyCookieOnSendHandler (fastifyReq, fastifyRes, payload, done) {
if (!fastifyRes[kReplySetCookies]) {
done()
return
}
if (fastifyRes[kReplySetCookies].size) {

@@ -107,0 +112,0 @@ setCookies(fastifyRes)

@@ -1255,1 +1255,23 @@ 'use strict'

})
test('do not crash if the onRequest hook is not run', (t) => {
t.plan(3)
const fastify = Fastify()
fastify.addHook('onRequest', async (req, reply) => {
return reply.send({ hello: 'world' })
})
fastify.register(plugin)
fastify.inject({
method: 'GET',
url: '/test1',
headers: {
cookie: 'foo=foo'
}
}, (err, res) => {
t.error(err)
t.equal(res.statusCode, 200)
t.same(JSON.parse(res.body), { hello: 'world' })
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc