Skip to content

Commit

Permalink
only clear when map is not empty (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday authored Aug 1, 2023
1 parent 54e9bdc commit 9cbcc17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ function setCookies (reply) {
function fastifyCookieOnSendHandler (fastifyReq, fastifyRes, payload, done) {
if (fastifyRes[kReplySetCookies].size) {
setCookies(fastifyRes)
fastifyRes[kReplySetCookies].clear()
}

fastifyRes[kReplySetCookies].clear()
fastifyRes[kReplySetCookiesHookRan] = true

done()
Expand Down

0 comments on commit 9cbcc17

Please sign in to comment.