Skip to content

Router: auto HEAD to GET#2949

Merged
aldas merged 1 commit into
labstack:masterfrom
aldas:alternative_heat_to_get
Jul 12, 2026
Merged

Router: auto HEAD to GET#2949
aldas merged 1 commit into
labstack:masterfrom
aldas:alternative_heat_to_get

Conversation

@aldas

@aldas aldas commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Proposal for alternative solution to #2944 (#2895) - do not register extra routes. use router internals to fallback from head to get. these extra IF checks do not register as meaningful change when running benchstat, but registering another route along with GET looks like a quick hack.

store benchmarks for this change

go test -run="-" -bench=".*" -count=8 ./... > benchmark_with_head.txt

check out current version

go test -run="-" -bench=".*" -count=8 ./... > benchmark_5_1_0.txt

and compare these two

benchstat benchmark_5_1_0.txt benchmark_with_head.txt 

usage:

Create Echo instance with Router that is configured with AutoHandleHEAD = true

			e := echo.NewWithConfig(echo.Config{
				Router: echo.NewRouter(echo.RouterConfig{
					AutoHandleHEAD: true,
				}),
			})

@codecov

codecov Bot commented Apr 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.29730% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.44%. Comparing base (01b45be) to head (c97f73c).
⚠️ Report is 28 commits behind head on master.

Files with missing lines Patch % Lines
response.go 96.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2949      +/-   ##
==========================================
+ Coverage   93.17%   93.44%   +0.26%     
==========================================
  Files          43       43              
  Lines        4501     4712     +211     
==========================================
+ Hits         4194     4403     +209     
+ Misses        189      188       -1     
- Partials      118      121       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@atharvaSharma17

atharvaSharma17 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Any updates on this ??

@aldas aldas changed the title WIP: Alternative heat to get WIP: Alternative HEAD to GET Jun 9, 2026
@aldas aldas force-pushed the alternative_heat_to_get branch 2 times, most recently from a1867aa to 58f8903 Compare June 9, 2026 19:18
@aldas aldas changed the title WIP: Alternative HEAD to GET Router: auto HEAD to GET Jun 9, 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>
@aldas aldas force-pushed the alternative_heat_to_get branch from 58f8903 to c97f73c Compare July 12, 2026 19:07
@aldas aldas merged commit 222be90 into labstack:master Jul 12, 2026
10 checks passed
@aldas aldas deleted the alternative_heat_to_get branch July 12, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants