Fastify 5.12.0
Overview
Fastify 5.12.0 was released on August 13, 2026, as the first minor update in the 5.x line since 5.11.x. The release focuses on response handling ergonomics, content-type validation, and test infrastructure cleanup. No breaking changes are included, and the upgrade path from any 5.11.x version is a drop-in replacement.
New Features
- Reply.prototype.mediaType — a new method for setting the media type on a reply, giving route handlers a cleaner way to declare response content types without reaching into raw headers.
- Content-type hardening — the content-type parser now returns
undefinedfor invalid media types instead of surfacing malformed values to downstream handlers.
Bug Fixes
- Removed raw response headers from the reply path in the 5.x backport, aligning the branch's behavior with the mainline.
- Fixed content-type handling so invalid media types no longer leak through as parse results.
Documentation and Testing
- Added documentation for per-route logging on Google Cloud Functions.
- Replaced
@sinonjs/fake-timerswith theprocess-warningspyWarning helper in the test suite. - Added a new sponsor acknowledgement (testmu ai) and refactored several backported test cases.
Upgrade Notes
Users on Fastify 5.x can update with npm install fastify@latest. The release contains no breaking changes or deprecations. If your middleware depends on the previous behavior of the content-type parser for invalid media types, review your error handling before upgrading.