Skip to content

Conversation

@yusukebe
Copy link
Member

@yusukebe yusukebe commented Feb 2, 2026

Resolves #3407

Add strict option to trimTrailingSlash and appendTrailingSlash middleware.

When strict: true, the middleware redirects before executing handlers, which fixes the issue where trailing slash handling doesn't work with wildcard routes (*).

app.use(trimTrailingSlash({ strict: true }))

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Bundle size check

main (f7d272a) #4658 (dd77cbd) +/-
Bundle Size (B) 18,377B 18,377B 0B
Bundle Size (KB) 17.95K 17.95K 0K

Compiler Diagnostics (tsc)

main (f7d272a) #4658 (dd77cbd) +/-
Files 303 303 0
Lines 141,166 141,166 0
Identifiers 128,937 128,937 0
Symbols 269,498 269,498 0
Types 202,695 202,695 0
Instantiations 609,801 609,801 0
Memory used 348,245K 337,921K -10,324K
I/O read 0.03s 0.02s -0.01s
I/O write 0s 0s 0s
Parse time 0.73s 0.74s 0.01s
Bind time 0.33s 0.31s -0.02s
Check time 2.9s 2.59s -0.31s
Emit time 0s 0s 0s
Total time 3.96s 3.65s -0.31s

Compiler Diagnostics (typescript-go)

main (f7d272a) #4658 (dd77cbd) +/-
Files 303 303 0
Lines 141,168 141,168 0
Identifiers 128,900 128,900 0
Symbols 390,634 390,777 143
Types 372,898 372,898 0
Instantiations 984,004 984,004 0
Memory used 254,286K 254,275K -11K
Memory allocs 2,553,316 2,553,277 -39
Config time 0.001s 0.001s 0s
Parse time 0.089s 0.121s 0.032s
Bind time 0.034s 0.023s -0.011s
Check time 0.606s 0.796s 0.19s
Emit time 0s 0s 0s
Total time 0.782s 1.047s 0.265s

Reported by octocov

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 38,399.28 52,763.34 33,790.68 28,643.82
hono (current) bun 38,842.36 53,313.14 34,818.20 28,395.73
Change +1.15% +1.04% +3.04% -0.87%

@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.45%. Comparing base (f7d272a) to head (afc4244).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4658      +/-   ##
==========================================
+ Coverage   91.43%   91.45%   +0.01%     
==========================================
  Files         173      173              
  Lines       11373    11393      +20     
  Branches     3296     3307      +11     
==========================================
+ Hits        10399    10419      +20     
  Misses        973      973              
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 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 added the v4.12 label Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trimTrailingSlash doesn't work on paths with *

3 participants