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

How to use hook: false? #290

Open
jpenna opened this issue Jun 27, 2024 · 1 comment
Open

How to use hook: false? #290

jpenna opened this issue Jun 27, 2024 · 1 comment

Comments

@jpenna
Copy link

jpenna commented Jun 27, 2024

Hello,

I set hook: false when registering the plugin to avoid parsing cookies for all routes and only parse them manually for the routes I wanted to read cookies.

Turns out this setting also disables setting cookies:

https://github.com/fastify/fastify-cookie/blob/cd9f41509753423deedfb480760adf710a0b4ec9/plugin.js#L147:L150

Isn't it a better behavior if it only disables parsing incoming cookies, but allows for setting cookies for responses?

@gurgunday
Copy link
Member

They are both hooks, so I'd expect the hooks setting to affect both

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

No branches or pull requests

2 participants