🔥 feat: Route Domain() func for host-based routing#4100
Conversation
Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
- errcheck: handle errors from io.ReadAll(resp.Body) with require.NoError - httpNoBody: use http.NoBody instead of nil in httptest.NewRequest - fieldalignment: reorder struct fields to minimize padding - errcheck: add error handling in benchmarks for app.Test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4100 +/- ##
==========================================
+ Coverage 91.07% 91.17% +0.10%
==========================================
Files 122 123 +1
Lines 11550 11832 +282
==========================================
+ Hits 10519 10788 +269
- Misses 651 658 +7
- Partials 380 386 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 694cabf | Previous: 92ada8a | Ratio |
|---|---|---|---|
BenchmarkDecoderedirectionMsgs - MB/s |
114.43 MB/s |
47.86 MB/s |
2.39 |
This comment was automatically generated by workflow using github-action-benchmark.
|
…main Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
Addressed in ed8cbb8:
|
|
Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
Addressed in 1f1dbd7:
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This is an excellent pull request that introduces host-based routing, a highly requested feature. The implementation is clean, non-intrusive, and aligns well with Fiber's existing API and performance goals. The "zero impact" on non-domain routes is a key achievement, and the comprehensive test suite, including benchmarks, provides strong confidence in the changes. The documentation is also very thorough. I have a couple of minor suggestions to improve code and documentation clarity.
…cs and What's New Co-authored-by: gaby <835733+gaby@users.noreply.github.com> Agent-Logs-Url: https://github.com/gofiber/fiber/sessions/3b8e28ed-0d0e-4c59-8bf1-10f2e03e6691
✅ Domain router review complete (commit 5f151ee): Feature Completeness:
Documentation:
Security:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot apply changes based on the comments in this thread |
…rustProxy docs Co-authored-by: gaby <835733+gaby@users.noreply.github.com> Agent-Logs-Url: https://github.com/gofiber/fiber/sessions/cebbf7c2-4fef-4eb0-b413-2d77a793c9f7
Co-authored-by: gaby <835733+gaby@users.noreply.github.com> Agent-Logs-Url: https://github.com/gofiber/fiber/sessions/cebbf7c2-4fef-4eb0-b413-2d77a793c9f7
All review items from the thread addressed in f45eb20 and 35d3784:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
…integration_test.go Co-authored-by: gaby <835733+gaby@users.noreply.github.com> Agent-Logs-Url: https://github.com/gofiber/fiber/sessions/bc0d7e65-69fb-4f4b-a291-43e08e397cd1
|
@claude[agent] Is it feasible to reduce code duplication within the |
The code duplication in domain.go is intentional and follows the established pattern in Fiber's codebase: Why the duplication exists:
What's actually duplicated:
What's NOT duplicated:
The current approach prioritizes performance and maintainability over DRY. Refactoring to reduce duplication would require either:
All Fiber router implementations follow this same pattern. The duplication is minimal (< 100 lines for all HTTP methods) and keeps the code fast, clear, and debuggable. |
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.