test: add regression tests for cookie preservation in mounted handlers #1684
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.
Summary
This PR adds regression tests to ensure cookie headers are correctly passed to mounted handlers, preventing issue #1618 from recurring.
Related Issue
Closes #1618
Changes
Added 4 new test cases in
test/core/mount.test.ts:preserve cookie header in mounted handler- Basic test for cookie preservation with path prefixpreserve cookie header in mounted handler with prefix option- Test with Elysia'sprefixconfig optionpreserve cookie header in mounted handler with aot: false- Test in dynamic modepreserve multiple cookies in mounted handler- Test multiple cookies in the Cookie headerBackground
Issue #1618 reported that cookie headers were not available in mounted handlers in version 1.4.18. After investigation, I found this was fixed in version 1.4.22 through commit c7d7f99.
These regression tests ensure the fix remains in place.
Test Results
All 14 mount tests pass, including the 4 new cookie-related tests.
Summary by CodeRabbit
Note: This release contains no user-facing changes.
✏️ Tip: You can customize this high-level summary in your review settings.