Feat: Add Automatic HEAD Support for GET Routes#2944
Closed
atharvaSharma17 wants to merge 3 commits into
Closed
Conversation
dmeremyanin
reviewed
Apr 15, 2026
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.
What this does
This adds an optional
AutoHeadflag that automatically enables HEAD requests for any GET route. No need to define separate HEAD handlers anymore.Why this is useful
Right now, if you want proper HEAD support, you have to manually add a HEAD route for every GET route. That leads to:
Content-LengthAccording to HTTP spec (RFC 7231), HEAD should behave like GET without a body — so this just makes Echo handle that for you.
How it works
When
AutoHeadis turned on:Content-Lengthis still set correctlyImplementation notes
AutoHeadtoEchoandConfigadd()) to register HEAD routesUsage
Performance
Very small overhead:
No impact if the feature is disabled (default).
Testing
Covers:
All tests pass.
Compatibility
Feature Request: Automatic HEAD request handling #2895 @markbates @aldas