Hono 4.13.1
OK so Hono 4.13.1 dropped today — less than a week after 4.13.0. I know what you are thinking: "another patch, another pointless changelog." But hear me out, because there are three real bugs being squashed here, and one of them is the kind of thing that only shows up in production at 3am.
TL;DR
- trie-router now counts every slash a pattern consumes — no more silent routing weirdness with nested wildcards
- stream
pipe()re-acquires the writer lock when it throws — the stream doesn’t deadlock your response anymore - etag middleware skips unsafe methods and error responses on the non-
*case — no more caching 500s and POST bodies
The Routing Fix Nobody Asked For But Everyone Needed
PR #5189 from first-time contributor @Jaybhade fixes the trie-router’s slash counting. What does that mean in plain English? Patterns with multiple slashes (think /api/:version//users or deeply nested wildcards) were consuming the wrong number of segments, so matches could land on the wrong handler. If you’ve ever had a route "randomly" hit the wrong middleware chain, this is probably your bug. Fixed now.
Stream Pipe: Lock It Down
@Sriharsha-dev369 (also a first-timer, love to see it) fixed the stream utils so that when pipe() throws, the writer lock gets re-acquired. Before this, a throwing pipe could leave the writer lock dangling and your stream would just... hang. No error, no response, just silence. That is the 3am bug I mentioned. This one is worth upgrading for alone if you serve any kind of streaming responses.
Etag: Don’t Cache The Crap
PR #5196 from @na-trium-144 makes the etag middleware skip unsafe methods (POST, PUT, DELETE, etc.) and error responses when you’re not using the * wildcard mode. Before, non-wildcard etag could stamp weak validators onto responses it had no business tagging — including error pages. That’s the kind of subtle bug that makes CDNs serve stale 500s to your users. Yikes.
Final Verdict
Three fixes, two new contributors, zero breaking changes. It’s a boring patch release in the best way possible. If you’re on 4.13.0, npm i [email protected] and move on with your life. If you’re still on 4.12.x, this is a good moment to catch up — the stream lock fix and the etag fix are both solid reasons.
Full changelog: github.com/honojs/hono/releases/tag/v4.13.1. Go update rn.