feat: add automatic HEAD request generation from GET request#2937
Closed
jean0t wants to merge 4 commits into
Closed
feat: add automatic HEAD request generation from GET request#2937jean0t wants to merge 4 commits into
jean0t wants to merge 4 commits into
Conversation
Contributor
|
@jean0t I think this would be better approach and more RFC comptible. See #2895 (comment) |
Author
|
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. |
Author
|
you were right regarding the ResponseWriter, we need to have this to avoid some errors and make the request correct |
vishr
added a commit
that referenced
this pull request
Jun 13, 2026
- 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>
vishr
added a commit
that referenced
this pull request
Jun 13, 2026
* 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>
Member
|
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. 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.