Skip to content

fix(lambda-edge): omit body in a 204 result - #5643

Merged
yusukebe merged 1 commit into
mainfrom
hono-kun/lambda-edge-204
Nov 16, 2026
Merged

yusukebe merged 1 commit into
mainfrom
hono-kun/lambda-edge-204

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.

Fixes the Lambda@Edge adapter returning a body field in a 204 result, which CloudFront answers with a 502 for a viewer request.

  • A 204 response now becomes a result with only status and headers. This is done in @hono/lambda-edge and in hono/lambda-edge.
  • Other bodyless responses keep body: ''. In an origin-response trigger, an empty body is how a function removes the body, so it is not left out.
  • The new tests check both cases.

Closes #5573.

@github-actions

Copy link
Copy Markdown

Bundle size check

main (6dc11ed) #5643 (bacd250) +/-
Bundle Size (B) 20,137B 20,137B 0B
Bundle Size (KB) 19.67K 19.67K 0K

Compiler Diagnostics (tsc)

main (6dc11ed) #5643 (bacd250) +/-
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 202,818K 156,784K -46,034K
I/O read 0s 0.01s +0.01s
I/O write 0s 0s 0s
Parse time 0.23s 0.2s -0.03s
Bind time 0.07s 0.07s 0s
Check time 0.93s 0.89s -0.04s
Emit time 0s 0s 0s
Total time 1.23s 1.16s -0.07s

Compiler Diagnostics (typescript-go)

main (6dc11ed) #5643 (bacd250) +/-
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,073K 154,030K -43K
Memory allocs 1,783,815 1,784,107 +292
Config time 0s 0.001s +0.001s
BuildInfo read time 0s 0s 0s
Parse time 0.069s 0.058s -0.011s
Bind time 0s 0s 0s
Check time 0.341s 0.324s -0.017s
Emit time 0.004s 0.003s -0.001s
Changes compute time 0.032s 0.018s -0.014s
Total time 0.466s 0.424s -0.042s

Reported by octocov

@github-actions

Copy link
Copy Markdown

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 108,857.19 131,854.06 105,233.46 89,484.06
hono (current) bun 109,450.69 134,355.78 104,987.27 89,009.01
Change +0.55% +1.90% -0.23% -0.53%

@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.30%. Comparing base (265f36b) to head (cfaed03).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5643   +/-   ##
=======================================
  Coverage   80.30%   80.30%           
=======================================
  Files         150      150           
  Lines       10737    10739    +2     
  Branches     2413     2414    +1     
=======================================
+ Hits         8622     8624    +2     
  Misses       2115     2115           

☔ 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 399e7c9 into main Nov 16, 2026
22 checks passed
@yusukebe
yusukebe deleted the hono-kun/lambda-edge-204 branch November 16, 2026 12:38
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.

@hono/lambda-edge includes a body in 204 viewer-request results

1 participant