Skip to content

fix(method-override): drop the body when overriding to GET or HEAD - #5641

Merged
yusukebe merged 1 commit into
mainfrom
hono-kun/method-override-bodyless
Nov 16, 2026
Merged

yusukebe merged 1 commit into
mainfrom
hono-kun/method-override-bodyless

Conversation

@hono-kun

@hono-kun hono-kun Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Hono-kun here, an AI maintainer, posting on behalf of @yusukebe.

  • Overriding a POST with a body to GET or HEAD made the Request constructor throw, so the response was 500.
  • Now the body and its Content-Type and Content-Length are dropped for GET and HEAD, in all four ways to override.
  • The form body path also drops the old Content-Length now.

Closes #5571.
Closes #5520.

@github-actions

Copy link
Copy Markdown

Bundle size check

main (bfdc972) #5641 (cfa344d) +/-
Bundle Size (B) 20,137B 20,137B 0B
Bundle Size (KB) 19.67K 19.67K 0K

Compiler Diagnostics (tsc)

main (bfdc972) #5641 (cfa344d) +/-
Files 83 83 0
Lines 59,460 59,460 0
Identifiers 60,641 60,641 0
Symbols 106,536 106,536 0
Types 163,092 163,092 0
Instantiations 414,023 414,023 0
Memory used 205,232K 206,476K +1,244K
I/O read 0s 0s 0s
I/O write 0s 0s 0s
Parse time 0.23s 0.18s -0.05s
Bind time 0.07s 0.06s -0.01s
Check time 0.97s 0.74s -0.23s
Emit time 0s 0s 0s
Total time 1.27s 0.99s -0.28s

Compiler Diagnostics (typescript-go)

main (bfdc972) #5641 (cfa344d) +/-
Files 215 215 0
Lines 121,022 121,022 0
Identifiers 107,365 107,365 0
Symbols 181,168 181,168 0
Types 262,348 262,348 0
Instantiations 621,588 621,588 0
Memory used 154,045K 154,017K -28K
Memory allocs 1,783,258 1,783,706 +448
Config time 0s 0s 0s
BuildInfo read time 0s 0s 0s
Parse time 0.071s 0.047s -0.024s
Bind time 0s 0s 0s
Check time 0.383s 0.281s -0.102s
Emit time 0.003s 0.003s 0s
Changes compute time 0.02s 0.016s -0.004s
Total time 0.499s 0.366s -0.133s

Reported by octocov

@github-actions

Copy link
Copy Markdown

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 34,397.36 47,162.53 30,858.59 25,170.95
hono (current) bun 33,521.03 46,401.29 30,042.61 24,119.20
Change -2.55% -1.61% -2.64% -4.18%

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.29%. Comparing base (fb48e2b) to head (8fd5194).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5641      +/-   ##
==========================================
+ Coverage   80.26%   80.29%   +0.02%     
==========================================
  Files         150      150              
  Lines       10712    10726      +14     
  Branches     2401     2409       +8     
==========================================
+ Hits         8598     8612      +14     
  Misses       2114     2114              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yusukebe
yusukebe merged commit 64a1d5a into main Nov 16, 2026
35 of 36 checks passed
@yusukebe
yusukebe deleted the hono-kun/method-override-bodyless branch November 16, 2026 12:05
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.

methodOverride returns 500 for a body-bearing POST overridden to GET methodOverride retains stale Content-Length after rewriting a form body

1 participant