Hapi 21.4.14
Hapi 21.4.14, the latest patch of the Node.js web framework, was published to npm on November 25, 2026. It closes a four-release run that began in October, and almost every change in that run concerns HTTP handling: how the framework validates host headers and how it finishes sending an error response.
The release itself is small. The tagged commit bumps two dependencies and nothing else. The substance is in the three patches before it, so the changelog worth reading is 21.4.10 to 21.4.14, not 21.4.14 alone.
What Changed
- 21.4.11, October 21. Error response transmission now retries a failed send, and the connection is closed when an error response cannot be transmitted at all. Both changes touch
lib/transmit.js, the code path that writes responses to the socket. - 21.4.12, October 28. A security bump of
subtext, the HTTP header parsing module used by hapi. - 21.4.13, November 4. Invalid host headers are rejected. This release adds 258 lines of request tests, which is a fair signal of how many edge cases the maintainers wanted pinned down.
- 21.4.14, November 25. A second security bump, this time of both
statehoodandsubtext.statehoodhandles cookie state for hapi's state management. - Typings. The
QUERYHTTP method is now part of the type definitions, so TypeScript projects can type request methods without casting around the union.
Why It Matters
Host header validation is the kind of fix that rarely shows up in a feature list but decides whether a routing layer can be tricked into serving the wrong virtual host. Combined with the header parser bumps, this run reads as defensive maintenance: reject malformed input early, and make sure a request that is going to fail still terminates cleanly.
The transmission fixes address the other half of that problem. A response that fails mid-write can leave a socket in an ambiguous state, and a client that is still waiting on bytes may retry a request the server already handled. Retrying the error response and then closing the connection is the conservative choice.
Compatibility
The engines field still says Node.js 14.15.0 or newer, so there is no platform floor change to plan around. No public API was removed in this range, and the changes are confined to request handling, server wiring, response transmission, and type definitions.
Upgrade
npm install @hapi/[email protected]. Because two of the four releases are security bumps of parsing code, projects pinned below 21.4.14 should treat this as a maintenance update rather than an optional one. If you run a reverse proxy in front of hapi, check that the proxy also normalizes the Host header, since the framework now rejects what it considers invalid rather than attempting to interpret it.