feat: add automatic HEAD request generation from GET request#2937
feat: add automatic HEAD request generation from GET request#2937jean0t wants to merge 4 commits into
Conversation
|
@jean0t I think this would be better approach and more RFC comptible. See #2895 (comment) |
|
I dont think it would be optimal to add a middleware if we can have it natively, also as I mentioned, it is the usual behavior in other frameworks. |
|
you were right regarding the ResponseWriter, we need to have this to avoid some errors and make the request correct |
- Correct net/http interop claim: Echo handlers are not http.Handler; interop is via WrapHandler/WrapMiddleware - Clarify binding ships with a pluggable validator (not built-in validation) - ROADMAP: reference canonical auto-HEAD issue/PR (#2895/#2949) instead of the duplicate PRs (#2944/#2937) slated for closure Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs: add liveness signals to README and a public ROADMAP - Add dynamic latest-release and last-commit badges (can't go stale) - Add positioning vs net/http and an "actively maintained" note - Add ROADMAP.md with version policy (v5 current, v4 LTS to 2026-12-31) and surface it from the README Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs: fix review findings in README/ROADMAP - Correct net/http interop claim: Echo handlers are not http.Handler; interop is via WrapHandler/WrapMiddleware - Clarify binding ships with a pluggable validator (not built-in validation) - ROADMAP: reference canonical auto-HEAD issue/PR (#2895/#2949) instead of the duplicate PRs (#2944/#2937) slated for closure Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thank you for tackling this — automatic HEAD support has been one of our most-requested features (#2895). We're consolidating the work into #2949, which takes a router-level approach with an opt-in hook so users keep control. Closing this in favor of that PR, but your work helped shape the direction and it's genuinely appreciated. Please follow and review #2949. 🙏 |
the behavior is opt-out.
I created one flag in both Echo and Group struct (since they are related to the register of new routes) that is private and a function to explicit cancel this behavior.
Why: Mentioned in the issue #2895 I searched and saw that the default behavior in many frameworks is to automatically register a head request with GET, so I agree with the author of the issue that it should be included to guarantee an expected behavior from the programmer.
I added tests and only modified the high level functions, if the author think it is good and relevant enough to be merged, it will be good.