Repository navigation
Releases
Releases Β· nestjs/nest
v12.5.0
v12.5.0 (2026-11-12)
Notable changes
New options
WsAdaptertakesmaxPayload, the largest message a client may send (1 MB by default, was 100 MB; a gateway's ownmaxPayloadtakes precedence,0lifts the limit); a larger message closes the connection with code 1009 β 109e52cd9bIoAdaptertakesmaxWaitingMessages, the number of a client's messages of one event that may wait beyond those being handled (10,000 by default;Infinitylifts it) β c98b5f782e- TCP server:
maxConcurrentMessages(1000 per connection by default;0lifts it) β 42c619cd69 - gRPC server:
maxPendingResponses(1000 by default;0disables), after which a streaming call whose client leaves its responses unread fails withRESOURCE_EXHAUSTEDβ ce6d44d858 - Redis server:
maxWildcardChannelLength(1024 characters by default;0disables) for requests matched through a wildcard subscription β 074dcf7c60 - RabbitMQ:
maxMessageSize(16 MiB by default) for messages and replies decoded as JSON β da6b3fc5bc @nestjs/platform-fastify: multipartlimits.jsonFieldsSize(1 MiB by default) for the fields of a request sent asapplication/jsonβ 958316696f
New defaults and behaviour changes
- TCP:
maxBufferSizedefaults to 16 Mi characters (was 128 Mi), in both directions β 55da0b0d33 β and now applies to each packet rather than to everything received in one read, so a burst of small packets no longer closes the connection (#18502) β ce285e6ad3 - TCP server: an empty or unset
hostnow listens on localhost; sethost: '0.0.0.0'(or'::') to listen on every interface β 4196d3655d @nestjs/platform-express,@nestjs/platform-node: multipart requests default to at most 1000 parts, which also caps afields,filesormaxCountabove 1000 unlesslimits.partsis raised β b2bbc17122- An upload option a route sets to
undefinedornullnow keeps the module's value; useInfinityto lift a limit β 7bc8d9121e - A limit option given as
NaN(e.g.Number(process.env.UNSET)) now gets its default instead of turning the limit off, for TCP, Kafka,WsAdapter,IoAdapter, the validation pipes and@Sse()β 8209d1c8be, f956177a0e, 5b58a6e89f ClassSerializerInterceptorandStandardSchemaSerializerInterceptorserialize each object a streamed HTTP response yields, so@Exclude(), groups and schemas apply to every line of NDJSON β 8217f2b3b8@Sse(): while Node.js has paused the socket of a client, a:comment is written every 5 s, so that a client that left is noticed β cd963b19bd@nestjs/platform-express,@nestjs/platform-node: aSyntaxErrororURIErrorwithout a 400 status (e.g. thrown by a middleware passed toapp.use()) is answered with a logged 500 rather than a 400 carrying its message β 8d74ddcd3a@nestjs/platform-node: when the matched route would leave a route parameter empty, the request is a 404 β 56c06f48c3- Middleware given to
forRoutes()is mounted where the router serves the routes it covers, including routes excluded from the global prefix β 521cdea80f - Parameter pipes of controllers built with mixins or wrapped by a class decorator that returns a Proxy now run β 7c5792d969
- The
excludepredicate ofenableCsrfProtection()excludes a request only when it returnstrueβ 608fcec0a9 - Gateways on their own port drop clients that connect before
onApplicationBootstrap()has finished; socket.io clients reconnect β 7d705cc835 - In a standalone microservice, a gateway without a port no longer opens a server on a random port; it gets a server that does not listen β 7359d3b06a
- An
@Optional()dependency that exists but fails to build at request time now fails its consumer β 0c360708b5 - Transient providers with durable dependencies are built per request β 822d93ffd1
moduleRef.create()rejects a request-scoped property dependency, as it does for constructor parameters β 6c5fed8b72
New startup errors and warnings
- A guard, interceptor or pipe that can't run (e.g. an abstract class used as a token, or a class given as the
useValueofAPP_GUARD) fails the application at startup; an exception filter that can't run logs a warning β 7a81aed500, 407518855f - An invalid
forRoutes()orexclude()entry fails the application at startup β 1afb768959 - A gateway that joins a shared server with a
verifyClientorallowRequestthe server won't run, or gateways on one port that set different hosts, stop the application at startup β 32875410dc, fd0155fba0 @nestjs/platform-fastify:@All('x')declared above@Search('x')or a WebDAV method on the same path fails at startup, as the reverse order already did;@All()routes now also answer these methods β a1695d18ea- Warnings for exception filter classes bound to a middleware, which don't apply β 3113f03f1e β and for a
ValidationPipethat gets no parameter types β f433a1f752
Microservices
- gRPC: an
Errorwrapped in anRpcExceptionis logged and answered as "Internal server error"; its numeric code is still used as the status β 2038bff425 - A filter that throws on a response stream is logged and answered as "Internal server error" β 515f99cfb6
- Kafka: events can no longer ask for a reply through reply headers, and replies no longer carry them β d1473338c3; an object with a
keyorvalueand other properties is sent as the payload β 73373dc911; a request whose reply topic is one the server handles itself is dropped β 809029b74b - RabbitMQ wildcards: a message whose pattern names a different handler than its routing key is not handled β ef8f92c5d0
- Patterns with a string value over 4096 characters or more than 100 keys get a marker route β ed8ca5cded; multi-key patterns with a non-ASCII key may get a new route, so clients and servers of such patterns should be on the same version β 015456cc2f
@nestjs/core and the platform packages should be updated together, as the adapters pass new route matching options to core.
Bug fixes
platform-fastify- fecdd4f9ef fix(fastify): fail an object-mode file stream on a non-bytes chunk (@kamilmysliwiec)
- 5f08564c8b fix(fastify): release file streams of pipelined requests on close ([@kamilmysliwiec](https://github.com/kamilmys...
v11.2.10
What's changed
@nestjs/common- fix(common): let a null depth print every level in the console logger β backport of #18480
- fix(common): count empty strings toward the json log record cap
- fix(common): check the json log record cap before converting values
- fix(common): limit the error messages of parsed array items in total
- fix(common): rethrow non-validation errors in the parse array pipe
- fix(common): drop the value of validation errors that have children
- fix(common): reject a buffer sent in place of a validated class
- fix(common): reject a buffer held by a nested validated property
- fix(common): validate a stand-in for a buffer sent as the whole value
- fix(common,core): use the default for pipe and sse limits given as nan
- fix(common): validate the files of parse file pipe one at a time
- fix(common): close the gaps of sparse arrays the pipes validate
- fix(common,core): count sse events without data toward the pending limit
- fix(common,core): send the status text in sse errors that wrap an error
- fix(common): keep the scope a class declares when passed to mixin()
@nestjs/core- fix(core): listen for the error of every stream the router holds
- fix(core): share one close listener among the requests of a connection
- fix(core): send what the interceptors return for a streaming handler
- fix(core): catch what the teardown of an sse producer throws
- fix(core): write the waiting events of an sse client in linear time
- fix(core): notice an sse client that left while its socket is paused
- fix(core): keep host params matched next to an optional group
- fix(core): answer http errors that graphql or async rpc filters leave
- fix(core): skip exception filters that were not created for a request
- fix(core): keep a controller root route next to an optional-tail route
- fix(core,fastify): exclude "/x/" only when no other route may serve it
- fix(core,fastify,node): match excluded params up to the router's limit
- fix(core,fastify): end the excluded path at ";" like the fastify router
- fix(core,fastify): match the text after an excluded param as written
- fix(core): run the middleware for a path with a line terminator
- fix(core): mount middleware where the router serves the covered routes
- fix(core): test each versioned path against the prefix exclusions alone
- fix(core): keep the filters of a middleware's use() with exclude()
- fix(core): warn that filter classes bound to a middleware do not apply
- fix(core): reject a middleware target that is not a controller or route β such an entry now fails the application at startup
- fix(core): mount module middleware in order when configure() awaits
- fix(core): resolve a forward reference to a module only once
- fix(core): mount a controller root route without the slash after a tail
- fix(core): mount middleware on a route path that really ends in "$"
- fix(core): keep create() working after many calls in snapshot mode
- fix(core): give unserializable dynamic modules their own deep-hash ids
- fix(core): build a lazy module once when loads overlap
- fix(core): fail the consumer when an optional dependency fails to load
- fix(core): keep transient instances out of durable sub-trees
- fix(core): inject the strategy payload into durable providers as request
- fix(core): inject the provider an alias stands for
- fix(core,websockets): read parameter metadata from the declaring class
- fix(core,common): read the catch types of a filter from its prototype
- fix(core): warn when a validation pipe gets no parameter types
- fix(core): use the enhancers of the module that holds the host
- fix(core): run the container instance of a class-bound enhancer
- fix(core): throw for a guard, interceptor or pipe that can't run β such a binding now fails the application at startup
- fix(core,microservices,websockets): drop gateway clients during startup
- fix(core): warn about an exception filter that can't run
- fix(core): settle sse lifecycle on early disconnect β backport of #17987
- fix(core): let exclusions cover routes excluded from the global prefix β backport of #18209
- fix(core): compare a prefix exclusion with a trailing slash as served
- fix(core): release the throwaway wrapper of each create() call β backport of #18137
- fix(core): reject create() when a dependency is request-scoped β backport of #18142
- fix(core): find the module of a host registered under another token
- fix(core): roll back modules on failed lazy load β backport of #18385
- fix(core): reject create() when a property dependency is request-scoped
- fix(core): release removed wrappers from the providers they depended on
- [fix(core): use the enhancers of the module that holds the host](https...
v12.4.1
v12.4.1 (2026-11-09)
Features
platform-node- #18435 feat(node): inject requests into the node adapter like the fastify one (@thekhegay)
- #18439 feat(node): set req.route on the node adapter like express does (@thekhegay)
Bug fixes
core- #18385 fix(core): roll back modules on failed lazy load (@Asadshah7950)
Enhancements
common,core- #18429 fix(core,common): warn when decorator metadata is missing (@kamilmysliwiec)
Dependencies
platform-ws- #18468 chore(deps): bump ws from 8.22.0 to 8.22.1 (@dependabot[bot])
Committers: 8
- Abdellatif Anaflous (@hktitof)
- Asad Ali Shah (@Asadshah7950)
- G (@gjija)
- Kamil Mysliwiec (@kamilmysliwiec)
- Maksym Lyskov (@maxymlyskov)
- Roman Khegay (@thekhegay)
- Thiago Nascimento (@ThiagoACNascimento)
- WooSeung Kim (@beyondwin)
v11.2.9
What's changed
@nestjs/core@nestjs/platform-express@nestjs/platform-fastify- fix(fastify): end the authority of absolute-form targets at the query β an absolute-form request target with a
/after a query that comes before its path is now answered with 404 - fix(deps): update dependency fastify to v5.12.8 β resolves the advisories published against fastify up to 5.12.4;
find-my-waymoves to 9.10.0 with it, sohttp://host?a=bis now routed as/
- fix(fastify): end the authority of absolute-form targets at the query β an absolute-form request target with a
v12.4.0
v12.4.0 (2026-11-06)
Features
platform-node- #18396 feat(node): let the node adapter set locals for every view (@thekhegay)
Bug fixes
microservices- #18418 fix(microservices): ignore an mqtt server's own replies under wildcards (@pavstev)
- #18413 fix(microservices): reach handlers whose string pattern reads as json (@pavstev)
- #18392 fix(microservices): forward grpc call options on request streams (@DenisCDev)
- #18393 fix(microservices): await the mqtt close and reset the client state (@hktitof)
commonplatform-node- #18417 fix(node): omit the Content-Length of a redirect with a Transfer-Encoding (@hktitof)
- #18415 fix(node): give each route that shares a path shape its own params (@pavstev)
- #18372 fix(node): strip trailing slashes when resolving view names (@saiyam-jain-dev)
- #18403 fix(node): omit content-length when transfer-encoding is set (@pavstev)
- #18395 fix(node): render with eta, liquidjs and art-template (@thekhegay)
- #18391 fix(node): add the charset to a content type the app sets (@pavstev)
platform-fastifycore,testingplatform-express,platform-fastify,platform-nodecore- #18407 fix(core): run middleware on subpaths next to an all-methods route (@beyondwin)
- #18401 fix(core): cache external handler metadata per context type (@kamilmysliwiec)
Enhancements
common,core- #18427 feat(core,common): send a web response or stream a handler returns (@kamilmysliwiec)
Dependencies
platform-fastify- #18422 fix(deps): update dependency @fastify/cors to v11.4.1 (@renovate[bot])
Committers: 8
- Abdellatif Anaflous (@hktitof)
- Denis Scarabelli (@DenisCDev)
- Kamil Mysliwiec (@kamilmysliwiec)
- Roman Khegay (@thekhegay)
- Ryan Johnson (@ryodine)
- Saiyam Jain (@saiyam-jain-dev)
- Stevan PavloviΔ (@pavstev)
- WooSeung Kim (@beyondwin)
v12.3.0
v12.3.0 (2026-10-27)
Features
platform-node- #18063 feat(node): add a native node http platform adapter (@kamilmysliwiec)
Bug fixes
common- #18289 fix(common): report the detected file type in file type errors (@DenisCDev)
- #18246 fix(common): avoid throwing for arrow prototype constructors (@fengxueweilai)
- #18220 fix(common): abort the response when a streamable file fails midway (@thekhegay)
core- #18276 fix(core): run middleware once for routes that differ only in version (@OmBhandwaldar)
- #18262 fix(core): tolerate sse request sockets without tuning methods (@SnowingFox)
- #18252 fix(core): read the url protocol from the server (@thekhegay)
- #18254 fix(core): name the array and index of undefined module entries (@thekhegay)
- #18235 fix(core): discover classes by each of their discovery decorators (@OmBhandwaldar)
- #18216 fix(core): read the abort on error option of the app being called (@thekhegay)
- #18209 fix(core): let middleware exclusions cover prefix-excluded routes (@thekhegay)
- #18210 fix(core): honor abortOnError passed to select() (@Cayan)
- #18215 fix(core): subscribe to handler observables from other rxjs copies (@koreahghg)
- #18201 fix(core): read a quoted media type version in the middleware exclusions (@hktitof)
- #18200 fix(core): resolve request-scoped forward refs for concurrent requests (@maxymlyskov)
common,microservices,platform-ws- #18285 fix(ws,microservices): load packages where bundlers can see them (@kamilmysliwiec)
common,microservices,websockets- #18272 fix(common): keep one route param per argument in an overriding method (@maxymlyskov)
platform-express- #18264 fix(express): map unsupported multipart content types to 415 (@seren-wib)
- #18234 fix(express): end a head response for an empty streamable file (@spokodev)
- #18232 fix(express): leave 5xx http-errors errors unmapped so they are logged (@kamilmysliwiec)
- #18214 fix(platform-express): map http-errors exceptions to HttpException in Express adapter (@okxint)
- #18199 fix(express): send the standard body for an exception wrapping an error (@KAPUIST)
platform-fastify- #18253 fix(fastify): send object error bodies with a json content type (@maxymlyskov)
- #18240 fix(fastify): leave 5xx fastify errors unmapped so they are logged (@thekhegay)
- #18239 fix(fastify): map 4xx http-errors errors to http exceptions (@kamilmysliwiec)
- #18226 fix(fastify): listen on a file descriptor (@thekhegay)
- #18217 fix(fastify): run cors before nest middleware (@kamilmysliwiec)
core,platform-express,platform-fastify,platform-socket.io,platform-ws,websockets- #18251 fix(core,express,fastify,ws,socket.io): load adapters with an older core (@thekhegay)
microservices- #18250 fix(microservices): re-arm the redis retries on a new listen (@hktitof)
- #18255 fix(microservices): report a nats connection that gave up reconnecting (@thekhegay)
- #18249 fix(microservices): do not emit a trailing null to kafka requesters (@thekhegay)
- #18256 fix(microservices): let a retriable exception keep travelling (@hktitof)
- #18238 fix(microservices): retry the tcp server again after close and listen (@kamilmysliwiec)
- #18223 fix(microservices): clear the tcp retry timer when a new listen starts (@hktitof)
- #18221 fix(microservices): honor mqtt topic filter boundaries (@fabric0de)
- #18229 fix(microservices): let only the exact message handler answer a request (@maxymlyskov)
- #18211 fix(microservices): fail the request when its last reply cannot be sent (@maxymlyskov)
- #18206 fix(microservices): reset the tcp retry attempts on each listen (@hktitof)
- #18204 fix(microservices): count every failed rmq connection attempt (@maxymlyskov)
- #18197 fix(microservices): send the record headers of nats as message headers (@hktitof)
Dependencies
platform-express- #18268 fix(deps): update dependency multer to v2.5.0 [security] (@renovate[bot])
common- #18257 fix(deps): update dependency file-type to v22.2.0 (@kamilmysliwiec)
platform-fastify- #18219 fix(deps): update dependency @fastify/middie to v9.3.6 (@renovate[bot])
Committers: 16
- Abdellatif Anaflous (@hktitof)
- Daniel Pinto (@Cayan)
- Denis Scarabelli (@DenisCDev)
- Junpei Zhang (@pei711)
- Kamil Mysliwiec (@kamilmysliwiec)
- Luke Son (@KAPUIST)
- Maksym Lyskov (@maxymlyskov)
- Om Bhandwaldar (@OmBhandwaldar)
- Roman Khegay (@thekhegay)
- Spoko Dev (@spokodev)
- @fengxueweilai
- @okxint
- snowingfox (@SnowingFox)
- yooseong (@seren-wib)
- κΉμ ν (Kim JungHyeon) (@fabric0de)
- νκ΅ (@koreahghg)
v11.2.8
What's changed
@nestjs/common- fix(common): reject non-numeric items in ParseArrayPipe with items Number β backport of #17876
- fix(common): reject arrays nested in ParseArrayPipe items β backport of #18073
- fix(common): skip array holes when stripping prototype keys
- fix(common): copy array and object defaults in
DefaultValuePipe - fix(common): cut json log records short past a million characters
- fix(common): strip a falsy constructor key from request data
- fix(common): validate parsed array items one at a time
- fix(common): stop copying nested validation errors for each level
- fix(common): reject arrays and primitives for validated classes
- fix(common): limit the length of validation error messages by default
- fix(common): stop exposing the validated object on validation errors
- fix(common): match a file type string up to the end of a name
- fix(common): handle
StreamableFileerrors raised before the reply - fix(common): keep
StreamableFileerror messages out of responses - fix(common): abort the response when a streamable file fails midway β backport of #18220
@nestjs/core- fix(core,express,fastify): match excluded routes like the router does
- fix(core): match excluded routes exactly when the router is unknown
- fix(core): answer host mismatches on fastify with 404
- fix(core): never exclude request targets with "#" or in absolute form
- fix(core): mount unversioned middleware paths under the default version
- fix(core): map controller middleware under every module declaring it
- fix(core): mount transient-scoped middleware instead of skipping it β on v11 this also mounts the middleware listed after a transient one, which was skipped as well
- fix(core): drop an overlapped middleware route only when it is covered
- fix(core): mount wildcard middleware on every path when "/" is excluded
- fix(core): mount middleware paths on routes excluded from the prefix
- fix(core): stop wildcard exclusions from covering their parent route
- fix(core): run middleware on a controller root excluded by a wildcard
- fix(core,common): exclude a version only for requests that ask for it
- fix(core,microservices,websockets): ignore inherited keys of non-objects
- fix(core): stop the Observable producer when the client disconnects β backport of #17826
- fix(core): end sse responses to head requests once headers are sent
- fix(core): do not send the message of an unexposed http error
- fix(core): destroy a
StreamableFiledropped by a timed-out handler - fix(core): destroy a
StreamableFilethat is not sent - fix(core,express,fastify): remove uploads of requests a pipe rejected
- fix(core): hand sse header errors to the exception filters
- fix(core): drop sse clients that stop reading their events
- fix(core): hide internal error messages from sse error events
- fix(core): make the sse pending data limit configurable
- fix(core): apply the expose flag of http errors to sse error events
- fix(core,microservices): run transient global enhancers on controllers β backport of #17993
- fix(core): stop silently dropping request-scoped global enhancers β backport of #18066; a global enhancer whose dependency tree is request-scoped is no longer silently skipped
- fix(core): fail at startup for request-scoped class global enhancers β backport of #18104; such an enhancer (e.g.
APP_GUARDwithuseClass) now fails at startup instead of running without its dependencies - fix(core): read class-level enhancers from the registered class
- fix(core): apply the enhancers of class providers under any token
- fix(core): run enhancers that are request-scoped through dependencies
- fix(core): fail at startup when a global enhancer is not instantiated
- fix(core): run transient global enhancers on static entry providers
- fix(core,websockets): run transient enhancers bound to static gateways
- fix(core): run guards bound as classes without a name
- fix(core): subscribe to guard observables from other copies of rxjs
- fix(core): run interceptor, pipe and filter classes without a name
@nestjs/platform-express- fix(express): run wildcard middleware on "/api/" for a named wildcard
- fix(express): apply middleware to controller root routes in strict mode
- fix(express): map multer array index and invalid field name codes to 400 β backport of #17857
- fix(express): destroy the
StreamableFilesource on client disconnect β backport of #17973 - fix(express): send object error bodies with a json content type
- fix(express,fastify): handle a
StreamableFilethat cannot be streamed - fix(express): stop reading a streamable file for a head request
@nestjs/platform-fastify
v12.2.0
v12.2.0 (2026-10-19)
Notable changes
New options
@Sse({ maxPendingDataLength })sets how many characters of event data may wait for a client that is not reading its events (4M by default;0orInfinitylifts the limit) β 2f05ad954eIoAdapterandWsAdaptertakemaxConcurrentMessages, the number of a client's messages handled at once (1000 by default;Infinitylifts it) β 0bd0810ed7ValidationPipetakesmaxErrorMessagesLength(1,000,000 characters by default); messages past it are replaced by a "Further validation errors were omitted" entry β 086c1c514f- Kafka:
parser.maxMessageSize(16 MiB after decompression by default); larger messages are logged and skipped β 9bdf844fca - TCP server:
drainTimeout(30 s by default,0disables) disconnects a peer that leaves its responses unread β 583d6077ad - MQTT server:
reconnectOnConnackErroris now enabled by default, so a refused connection attempt is retried; set it tofalsefor the previous behaviour β a63cea600a HttpServer.getRouteMatchingOptions(), an optional adapter hook that tells core how the router matches paths (see "Middleware exclusions" below) β 08d8677c8d
New defaults and behaviour changes
@nestjs/platform-express,@nestjs/platform-fastify:fieldNestingDepthandfieldArrayIndexLimit(#18074) now default to 32 and 1000; set them toInfinityto lift the limits β 94fcc93770ValidationPipevalidates withvalidationError.target: falseunless the options set it, so anexceptionFactorythat readserror.targetgetsundefined; setvalidationError.targettotruefor the old errors β 8c5a59bf63ValidationPipeanswers an array or a primitive sent for a validated class with a 400 β 197371c1f3FileTypeValidatormatches a stringfileTypeup to the end of a name (e.g.font/woffno longer acceptsfont/woff2; use a RegExp for that) β 770c6f1a19@SerializeOptions({})on a handler no longer turns off the class schema β d27cb7017fBaseExceptionFilteranswershttp-errorserrors created withexpose: false(the default from 500) with the standard reason phrase instead of their message β 9ed572f853- A
StreamableFileerror still gets a 400, but the body no longer carries the error message β 2f28d91afb - Files uploaded with a request that a pipe rejected are removed from storage β acb98de89e
@nestjs/platform-fastify: a route withfileSize: undefined(ornull) falls back to the plugin's limit; set it toInfinityto keep uploads unlimited β dd549e1a74@nestjs/platform-express: object error bodies are sent asapplication/jsonon routes with a non-JSONContent-Typeβ 7dc6e349d5ConsoleLoggerin JSON mode cuts a record short past about a million characters β ad4915eaa3- A global enhancer that the injector failed to instantiate now fails the application at startup β ae78524ced
- A request- or transient-scoped
APP_FILTERnow logs a startup warning, as it only applies to exceptions thrown from controllers β df5275c5e1 - Microservices: a pattern key longer than 256 characters matches no handler β accd27e66c
- Kafka: a message may carry up to 10,000 header values (e419ff540b); headers given as a string or array are not sent (312777743f); reply headers are decoded as text (ee94f6aaae)
- gRPC: request streams are paused while their replies wait to be written β 37e5cf7706
- Deprecation: on TCP, Redis, NATS, MQTT and RabbitMQ, an
@EventPattern()handler that replies toClientProxy#send()now logs a deprecation warning. The reply is unchanged; in the next major version event handlers will not reply tosend(), as on Kafka already β ba3668d36b
Middleware exclusions
MiddlewareConsumer.exclude()now compiles excluded routes with the router's case and trailing-slash matching (08d8677c8d). Update@nestjs/coretogether with@nestjs/platform-express/@nestjs/platform-fastify: with an adapter that does not implementgetRouteMatchingOptions(), excluded routes are matched exactly (f5aa875e40), so on a lenient router other spellings of an excluded path run the middleware.- With header, media type or custom versioning,
exclude({ path, method, version })andenableCsrfProtection({ exclude })apply only to requests that ask for one of the excluded versions β 1a7a31fa46 @nestjs/platform-fastify: the request hook used byenableCsrfProtection()anduseSecurityHeaders()now runs before Nest andapp.use()middleware withNestFactory.create()too, including middleware registered before either call, as it already did withTest.createNestApplication()β 8351806290
Bug fixes
platform-fastify- 614d1ac7ea fix(fastify): send the status of an exception whose body is an error (@kamilmysliwiec)
- 8b420f788f fix(fastify): apply middleware to plugins registered before init (@kamilmysliwiec)
- #18175 fix(fastify): keep raw-response cookies in the header helpers (@johnnyhuirilef)
- c215fd9b4f fix(fastify): match middleware paths like a case-insensitive router (@kamilmysliwiec)
- 43d4420205 fix(fastify): pass version extractor errors to the error handler (@kamilmysliwiec)
- 1435ed22f4 fix(fastify): pass middleware rejections to the error handler (@kamilmysliwiec)
- 84c947faf9 fix(fastify): stop reading a streamable file for a head request (@kamilmysliwiec)
- dd549e1a74 fix(fastify): let undefined upload limits fall back to the defaults (@kamilmysliwiec)
- 4735f8d050 fix(fastify): free memory storage chunks once a file is buffered (@kamilmysliwiec)
- 3e3e6eea6f fix(fastify): remove uploads cut off after their last chunk (@kamilmysliwiec)
- c04a9182b9 fix(fastify): set the security headers on router error responses (@kamilmysliwiec)
- a03c7a1db6 fix(fastify): answer request targets that are not a path with 404 (@kamilmysliwiec)
- #18156 fix(fastify): apply route options to all-method routes (@Ahmad-Mosha)
microservices
v12.1.3
v12.1.3 (2026-10-12)
Bug fixes
core,microservices- #18111 fix(core,microservices): flush buffered logs when initialization fails (@thekhegay)
- #17993 fix(core,microservices): run transient global enhancers on controllers (@johnnyhuirilef)
platform-express- #18110 fix(express): guard async request hook completion (@GiHoon1123)
- #17973 fix(express): destroy the
StreamableFilesource on client disconnect (@maxymlyskov) - #17942 fix(express): run wildcard middleware on the bare global prefix path (@Chaoqi31)
core- #18104 fix(core): fail at startup for request-scoped class global enhancers (@thekhegay)
- #18066 fix(core): stop silently dropping request-scoped global enhancers (@OmBhandwaldar)
- #18072 fix(core): resolve uri versioned exclusions for the not-found handler (@basteez)
- #18075 fix(core): normalize slashes when mapping controllers for middleware (@basteez)
- #18086 fix(core): do not mutate the message when assigning an sse event id (@Metehan-Bicer)
- #18025 fix(core): end sse streams whose event data cannot be serialized (@OmBhandwaldar)
- #18011 fix(core): send status and headers set by handlers on sse responses (@johnnyhuirilef)
- #18021 fix(core): honor a shutdown signal received while close() is in flight (@maxymlyskov)
- #17987 fix(core): settle SSE lifecycle on early disconnect (@jackie-cqz)
- #17986 fix(core): commit SSE headers for empty streams (@jackie-cqz)
- #17978 fix(core): preserve explicit null values in reflectable decorators (@gophersg)
- #17966 fix(core): run the shutdown sequence after a failed init (@kamilmysliwiec)
- #17963 fix(core): send the expires header on sse responses (@Mohamed-Elshesheny)
- #17953 fix(core): honor global prefix exclusions for overlapping versions (@Chaoqi31)
- #17950 fix(core): let a
GETmiddleware exclusion coverHEADrequests (@Chaoqi31) - #17951 fix(core): reset the listening state when the application closes (@Chaoqi31)
- #17945 fix(core): hash
Map,SetandRegExpoptions in deep-hash tokens (@Chaoqi31) - #17947 fix(core): treat
VERSION_NEUTRALin middleware routes as no version (@Chaoqi31) - #17941 fix(core): turn off express
x-powered-byinuseSecurityHeaders()(@Chaoqi31) - #17939 fix(core): name dynamic host modules in import error messages (@Chaoqi31)
- #17940 fix(core): isolate nested transient providers injected into properties (@Chaoqi31)
microservices- #18108 fix(microservices): keep nats status updates alive when a listener throws (@kamilmysliwiec)
- #18100 fix(microservices): default server options like the client factory does (@thekhegay)
- #18083 fix(microservices): match rmq '#' wildcards in any position (@thekhegay)
- #18095 fix(microservices): fail mqtt requests whose publish fails (@izg0820)
- #18085 fix(microservices): preserve null payloads in kafka tombstone records (@Hangell)
- #18081 fix(microservices): close the connection when the channel close fails (@hktitof)
- #18071 fix(microservices): return the rmq reply publish so failures are handled (@maxymlyskov)
- #18060 fix(microservices): fail redis listen on rejected subscriptions (@kamilmysliwiec)
- #18056 fix(microservices): clone the kafka record before serializing (@Mihir-Rabari)
- #18054 fix(microservices): do not crash when the redis connection drops (@maxymlyskov)
- #18043 fix(microservices): fail pending kafka request on deserializer error (@hktitof)
- #18002 fix(microservices): wait for the TCP TLS handshake (@jackie-cqz)
- #17995 fix(microservices): survive custom deserializer errors in clients (@johnnyhuirilef)
- #18027 fix(microservices): close both kafka client connections when one fails (@izg0820)
- #18008 fix(microservices): unwrap records returned by message handlers (@johnnyhuirilef)
- #18001 fix(microservices): wait for both Redis clients to be ready (@jackie-cqz)
- #18000 fix(microservices): ignore stale NATS status events (@jackie-cqz)
- #17996 fix(microservices): preserve MQTT payload options (@jackie-cqz)
- #17989 fix(microservices): suspend incomplete packet timers during backpressure (@jackie-cqz)
- #17988 fix(microservices): cancel pending TCP retries on close (@jackie-cqz)
- #17972 fix(microservices): keep grpc response errors out of the request stream (@drakeo338)
- #17957 fix(microservices): fail rmq connect and listen on channel setup errors (@johnnyhuirilef)
- #17961 fix(microservices): run every event handler when a sibling completes empty (@johnnyhuirilef)
- #17959 fix(microservices): fail nats requests on undecodable replies (@johnnyhuirilef)
- #17955 fix(microservices): stop rmq client opening two channels on connect (@johnnyhuirilef)
- #17946 fix(microservices): answer client-streaming calls that return nothing (@Chaoqi31)
- #17943 fix(microservices): resolve grpc stream calls that complete empty (@hktitof)
platform-fastify- #18109 fix(fastify): answer the shutdown hooks 503 with fastify's json body (@kamilmysliwiec)
- #18101 fix(fastify): honor
return503OnClosingduring the shutdown hooks (@thekhegay) - #18059 fix(fastify): reject listen() on an invalid port (@kamilmysliwiec)
- #18053 fix(fastify): listen on a socket path (@johnnyhuirilef)
- #17997 fix(fastify): settle async lifecycle hooks once (@jackie-cqz)
- [#17998](https://github.com/nestj...
v12.1.1
v12.1.1 (2026-09-28)
Bug fixes
common,core,microservices,testing- #17893 fix(common): logger bugs in json output, level changes, fatal and buffered logs (@kamilmysliwiec)
microservices- #17891 fix(microservices): let the mqtt client retry after a failed connect (@hktitof)
- #17888 fix(microservices): keep tcp event listeners across reconnects (@KAPUIST)
- #17887 fix(microservices): ignore events from a replaced tcp client socket (@KAPUIST)
- #17878 fix(microservices): keep a newer nats connection when a stale one fails (@hktitof)
- #17869 fix(microservices): keep a newer kafka connection when a stale one fails (@kamilmysliwiec)
- #17865 fix(microservices): let the rmq client retry after a failed connect (@hktitof)
- #17866 fix(microservices): reply on the request channel when redis wildcards are enabled (@fadiroot)
- #17861 fix(microservices): recover the nats client after it gives up reconnecting (@xia-chao)
commoncoreplatform-fastifycore,testing
Enhancements
common- #17876 fix(common): reject non-numeric items in ParseArrayPipe with items Number (@SulimanAbdulrazzaq)
microservices
Committers: 13
- Abdellatif Anaflous (@hktitof)
- Alejandro (@lehafari)
- Daniel Pinto (@Cayan)
- Dharmik Sondagar (@DharmikSondagar)
- Kamil Mysliwiec (@kamilmysliwiec)
- Lazizbek Ergashev (@lazerg)
- Luke Son (@KAPUIST)
- Micael Levi L. Cavalcante (@micalevisk)
- Roman Khegay (@thekhegay)
- Suliman Abdulrazzaq (@SulimanAbdulrazzaq)
- Xia Chao (@xia-chao)
- @erezcor
- fadi romdhan (@fadiroot)