fix: clear event.res after prepare#1259
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughClears the prepared response stored on the event object after computing a prepared response to avoid duplicated response side-effects, adds an export for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
event.res headers after prepare
event.res headers after prepareevent.res after prepare
h3js/h3#1259 broke formdata handling in server functions, so pin h3 to a working version temporarily
resolves #1257 similar issue to #1226
When using
onResponsemiddleware helper, it internally usestoResponse, which merges headers. In final response we merge headers again which can cause duplicate cookies.Although we could call
toResponsewith a special flag to avoid merge in middleware, this PR fixes the root cause by always clearingevent.responsestate after first prepare to avoid similar issues.Summary by CodeRabbit
New Features
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.