Repository navigation
refactor!: Use Headers class instead of Map<String, String> when passing headers - #4175
Conversation
📝 WalkthroughWalkthroughHTTP response headers in the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–30 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.dart📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/lib/**/*.dart📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (5)📓 Common learnings📚 Learning: 2025-11-03T15:40:41.827ZApplied to files:
📚 Learning: 2025-07-02T16:07:50.947ZApplied to files:
📚 Learning: 2025-09-17T16:09:20.868ZApplied to files:
📚 Learning: 2025-08-25T19:46:58.073ZApplied to files:
🔇 Additional comments (5)
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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
To be honest I think setting default headers, etc. belong in the configure middleware realm. However we currently only support middleware on |
exaby73
left a comment
There was a problem hiding this comment.
Small discussion point but I think it might be overkill
SandPod
left a comment
There was a problem hiding this comment.
Changes looks good to me! 🚀
Description
Refactors HTTP header handling to use relic's
Headerstype instead ofMap<String, dynamic>.Changes:
httpResponseHeadersandhttpOptionsResponseHeadersfields inServerandServerpodclasses fromMap<String, dynamic>toHeaders_headers()handler to work directly withHeadersinstances usingHeaders.transform()Headers.build()Fixes #4102
Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.Breaking changes
Users who directly instantiate
ServerpodorServerwith custom headers need to useHeaders.build()instead of Map literals. Users relying on default headers are not affected.Summary by CodeRabbit