Skip to content

fix(http): preserve multiple custom route cookies - #361

Merged
punkpeye merged 1 commit into
punkpeye:mainfrom
pacocartones:fix/custom-route-set-cookie
Sep 6, 2026
Merged

fix(http): preserve multiple custom route cookies#361
punkpeye merged 1 commit into
punkpeye:mainfrom
pacocartones:fix/custom-route-set-cookie

Conversation

@pacocartones

@pacocartones pacocartones commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve every Set-Cookie value returned by a custom Hono route
  • avoid collapsing cookies through repeated Node setHeader calls
  • add a regression covering two cookies with distinct attributes

Hono keeps multiple cookies separately, but iterating its headers and calling res.setHeader("set-cookie", value) overwrites the earlier value. This change skips that header during the generic copy and assigns Hono's complete getSetCookie() array once.

Validation

  • regression receives only the second cookie on the parent commit and both cookies with this change
  • 23 route tests pass
  • full lint, type checking and JSR publish dry-run pass

@punkpeye
punkpeye merged commit 276890e into punkpeye:main Sep 6, 2026
2 checks passed
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 4.20.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants