npm / @hono/node-server
@hono/node-server
What changed in @hono/node-server 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-20.
6 breaking9 security4 new APIs and options4 performance31 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@hono/node-server 243 changes
Breaking changes 6
Requests with a raw backslash in the path are rejected with 400 Bad Request, preventing path-based access-control bypasses.
Static file serving now serves only GET and HEAD requests.
Rejects request paths that still contain % after decoding, preventing crafted requests from bypassing middleware on static paths. Set allowPercentInPath: true to serve files whose names contain a literal %.
The Vercel adapter was removed; deploy without it on modern Vercel runtimes, or recreate its behavior with getRequestListener.
Support for Node.js v18 has ended; the adapter now requires Node.js v20 or later.
Request handling returns an error object instead of throwing.
Security 5
With allowPercentInPath enabled, serveStatic accepts a second decode only when its result equals the routed path with %25 replaced by %, preventing a middleware bypass while preserving requests for file names containing a literal %.
Socket error and close events are handled while the application runs, and pending upgrades are released when the socket closes, preventing process termination from an unhandled
ECONNRESET.Upgrade request URLs now take their host from the
Hostheader, preventing a request-target beginning with//from replacing it.Node.js Adapter for Hono: Unauthenticated memory-leak DoS via aborted WebSocket handshake
Fixed a security issue that could let requests bypass prefix-mounted Serve Static Middleware on Windows.
New APIs and options 4
Added bytes() to the lightweight Request and Response.
Adds middleware for sending Early Hints (HTTP 103).
Adds the --no-git-checks option to pnpm stage publish for skipping Git checks when publishing.
The adapter adds first-class support for WebSockets.
Performance 4
Avoids chaining a promise per chunk while streaming a response.
Request headers are now materialized lazily, improving performance.
Request handling uses a fast path for the PATCH method.
Request handling uses a fast path for QUERY methods.
Fixes and other changes 24
Buffered chunks are drained when recovering a body after disconnect.
Added support for native Request and Response with Symbol.hasInstance.
Forwards duplex to the native request.
Does not send a complete response when the body fails during the early read.
Cancels late HTTP/2 response bodies.
Cancels the response body when the client has already disconnected.
The request signal is aborted when an HTTP/2 client resets the stream.
Hono v5 is now allowed as a peer dependency of @hono/node-server.
Avoids mutating response headers when setting Content-Length.
Fixes a type error in early hints.
Avoids an uncaught error when force-closing a non-standard socket.
Headers are now copied when the response initializer is a foreign Response.
Polyfills the missing ErrorEvent global for WebSocket support.
Corrects edge cases in Range header parsing for static file serving.
Recovers complete request bodies after a client disconnects.
Precompressed files are now served for application/octet-stream.
Cloning a Response with liveheaders now preserves its status and statusText.
Stubs ws types to prevent them from leaking into public types.
Headers mutated after raw Response construction are now preserved.
The Date header no longer uses file birthtime.
serveStatic handles backpressure in the stream fallback.
Hono response headers are now forwarded during WebSocket upgrade.
Response.json() receives improved specification compliance and efficiency.
Response.redirect() receives improved specification compliance and efficiency.
@hono/node-server 111 changes
Security 4
This option allows serving files whose names contain a literal %, with a hardened check against double-decoding; the README notes a caveat about route-level access control.
After routing, serveStatic skips request paths that still contain %, preventing a second decode from serving a different path and bypassing middleware.
@hono/node-server: Middleware bypass via repeated slashes in serveStatic
@hono/node-server has authorization bypass for protected static paths via encoded slashes in Serve Static Middleware
Fixes and other changes 7
Added custom inspect to lightweight Request and Response to prevent TypeError when using console.log.
Fixes request draining for early 413 responses.
The fast path no longer overwrites Content-Length when it already exists.
The Node server no longer overwrites global.fetch.
serveStatic now uses Readable.toWeb.
Fixes incorrect content-length after following a symlink.
Fixed the timing of onFound in serve-static.