@fastify/cookie
Advanced tools
Comparing version 9.0.3 to 9.0.4
{ | ||
"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' }) | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72694
1881