-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Fix @fastify/session #240
Merged
Merged
Fix @fastify/session #240
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Matteo Collina <hello@matteocollina.com>
cc @gurgunday |
Uzlopak
approved these changes
Aug 1, 2023
There was a problem hiding this 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 test, LGTM
Oh I see, yeah lgtm too, but will just test something real fast |
Can you take a look? |
bodinsamuel
referenced
this pull request
in specfy/specfy
Aug 7, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@fastify/cookie](https://github.com/fastify/fastify-cookie) | [`8.3.0` -> `9.0.4`](https://renovatebot.com/diffs/npm/@fastify%2fcookie/8.3.0/9.0.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@fastify%2fcookie/9.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@fastify%2fcookie/9.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@fastify%2fcookie/8.3.0/9.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@fastify%2fcookie/8.3.0/9.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>fastify/fastify-cookie (@​fastify/cookie)</summary> ### [`v9.0.4`](https://github.com/fastify/fastify-cookie/releases/tag/v9.0.4) [Compare Source](https://github.com/fastify/fastify-cookie/compare/v9.0.3...v9.0.4) #### What's Changed - Fix support for response that does not set a cookie by [@​mcollina](https://github.com/mcollina) in [https://github.com/fastify/fastify-cookie/pull/247](https://github.com/fastify/fastify-cookie/pull/247) **Full Changelog**: fastify/fastify-cookie@v9.0.3...v9.0.4 ### [`v9.0.3`](https://github.com/fastify/fastify-cookie/releases/tag/v9.0.3) [Compare Source](https://github.com/fastify/fastify-cookie/compare/v9.0.2...v9.0.3) #### What's Changed - Do not crash if responding from a previously-registered onRequest hook by [@​mcollina](https://github.com/mcollina) in [https://github.com/fastify/fastify-cookie/pull/245](https://github.com/fastify/fastify-cookie/pull/245) **Full Changelog**: fastify/fastify-cookie@v9.0.2...v9.0.3 ### [`v9.0.2`](https://github.com/fastify/fastify-cookie/releases/tag/v9.0.2) [Compare Source](https://github.com/fastify/fastify-cookie/compare/v9.0.1...v9.0.2) #### What's Changed - use for loop instead of for...of by [@​gurgunday](https://github.com/gurgunday) in [https://github.com/fastify/fastify-cookie/pull/239](https://github.com/fastify/fastify-cookie/pull/239) - Check if onSend ran and keep resetting the map by [@​gurgunday](https://github.com/gurgunday) in [https://github.com/fastify/fastify-cookie/pull/242](https://github.com/fastify/fastify-cookie/pull/242) - perf: only clear map when it's populated by [@​gurgunday](https://github.com/gurgunday) in [https://github.com/fastify/fastify-cookie/pull/243](https://github.com/fastify/fastify-cookie/pull/243) - perf: only call removeHeader when needed by [@​gurgunday](https://github.com/gurgunday) in [https://github.com/fastify/fastify-cookie/pull/244](https://github.com/fastify/fastify-cookie/pull/244) **Full Changelog**: fastify/fastify-cookie@v9.0.1...v9.0.2 ### [`v9.0.1`](https://github.com/fastify/fastify-cookie/releases/tag/v9.0.1) [Compare Source](https://github.com/fastify/fastify-cookie/compare/v9.0.0...v9.0.1) #### What's Changed - Fix [@​fastify/session](https://github.com/fastify/session) by [@​mcollina](https://github.com/mcollina) in [https://github.com/fastify/fastify-cookie/pull/240](https://github.com/fastify/fastify-cookie/pull/240) **Full Changelog**: fastify/fastify-cookie@v9.0.0...v9.0.1 ### [`v9.0.0`](https://github.com/fastify/fastify-cookie/releases/tag/v9.0.0) [Compare Source](https://github.com/fastify/fastify-cookie/compare/v8.3.0...v9.0.0) #### What's Changed - fix(docs): msecs to seconds ([#​219](https://github.com/fastify/fastify-cookie/issues/219)) by [@​seia-soto](https://github.com/seia-soto) in [https://github.com/fastify/fastify-cookie/pull/220](https://github.com/fastify/fastify-cookie/pull/220) - chore(deps-dev): bump sinon from 14.0.2 to 15.0.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/fastify/fastify-cookie/pull/222](https://github.com/fastify/fastify-cookie/pull/222) - chore(deps-dev): bump tsd from 0.24.1 to 0.25.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/fastify/fastify-cookie/pull/223](https://github.com/fastify/fastify-cookie/pull/223) - chore(.gitignore): add clinic by [@​Fdawgs](https://github.com/Fdawgs) in [https://github.com/fastify/fastify-cookie/pull/226](https://github.com/fastify/fastify-cookie/pull/226) - chore(.gitignore): add bun lockfile by [@​Fdawgs](https://github.com/Fdawgs) in [https://github.com/fastify/fastify-cookie/pull/228](https://github.com/fastify/fastify-cookie/pull/228) - chore(deps-dev): bump tsd from 0.25.0 to 0.26.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/fastify/fastify-cookie/pull/229](https://github.com/fastify/fastify-cookie/pull/229) - chore(deps-dev): bump tsd from 0.26.1 to 0.27.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/fastify/fastify-cookie/pull/230](https://github.com/fastify/fastify-cookie/pull/230) - chore(deps-dev): bump tsd from 0.27.0 to 0.28.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/fastify/fastify-cookie/pull/231](https://github.com/fastify/fastify-cookie/pull/231) - ci: only trigger on pushes to main branches by [@​Fdawgs](https://github.com/Fdawgs) in [https://github.com/fastify/fastify-cookie/pull/232](https://github.com/fastify/fastify-cookie/pull/232) - chore(deps-dev): bump [@​types/node](https://github.com/types/node) from 18.16.5 to 20.1.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/fastify/fastify-cookie/pull/233](https://github.com/fastify/fastify-cookie/pull/233) - Fix typo from 'node' to 'none' in CookieSerializeOptions for sameSite attribute by [@​Mihai-MCW](https://github.com/Mihai-MCW) in [https://github.com/fastify/fastify-cookie/pull/236](https://github.com/fastify/fastify-cookie/pull/236) - Don't send the `Set-Cookie` header multiple times for the same cookie by [@​gurgunday](https://github.com/gurgunday) in [https://github.com/fastify/fastify-cookie/pull/237](https://github.com/fastify/fastify-cookie/pull/237) #### New Contributors - [@​seia-soto](https://github.com/seia-soto) made their first contribution in [https://github.com/fastify/fastify-cookie/pull/220](https://github.com/fastify/fastify-cookie/pull/220) - [@​Mihai-MCW](https://github.com/Mihai-MCW) made their first contribution in [https://github.com/fastify/fastify-cookie/pull/236](https://github.com/fastify/fastify-cookie/pull/236) - [@​gurgunday](https://github.com/gurgunday) made their first contribution in [https://github.com/fastify/fastify-cookie/pull/237](https://github.com/fastify/fastify-cookie/pull/237) **Full Changelog**: fastify/fastify-cookie@v8.3.0...v9.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 4pm on friday,before 9am on monday,every weekend" in timezone Europe/Paris, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/specfy/specfy). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yNy4xIiwidXBkYXRlZEluVmVyIjoiMzYuMjcuMSIsInRhcmdldEJyYW5jaCI6ImNob3JlL3Jlbm92YXRlQmFzZUJyYW5jaCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commits fixes the
@fastify/session
module that was broken due to the changes introduced in #237 (v9.0.0).The problem is that the
onSend
hook installed by@fastify/cookie
was firing before theonSend
hook in@fastify/session
, essentially not sending the cookie added by@fastify/session
.I added a tiny provision for this case.