Skip to content
New issue

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

set cookie map to null after sendHeaders run #241

Closed
wants to merge 1 commit into from

Conversation

gurgunday
Copy link
Member

@gurgunday gurgunday commented Aug 1, 2023

The second hook will not set a cookie since sendHeaders won't reset the Map

  fastify.addHook('onSend', async (req, reply, payload) => {
    reply.setCookie('foo', 'foo', { path: '/' })
  })

  fastify.addHook('onSend', async (req, reply, payload) => {
    reply.setCookie('foo', 'foos', { path: '/' })
    return payload
  })

Checklist

@gurgunday gurgunday mentioned this pull request Aug 1, 2023
@Uzlopak Uzlopak requested a review from mcollina August 1, 2023 12:18
Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the unit tests, LGTM

@gurgunday
Copy link
Member Author

Superseded by: #242

@gurgunday gurgunday closed this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants