Middleware and CSRF exclusions now also cover the routes excluded from the global prefix that they match, which the router serves without the prefix. Such a route now skips the middleware or the CSRF check, as the same exclusion already does for routes under the prefix.
When none of a route's params has a pipe, the params are resolved and the controller is called synchronously, so it runs a few microtasks earlier than before (as routes without params already did).
* fix(core,microservices): flush buffered logs when initialization fails
* fix(microservices): read autoflushlogs from the top-level options
For a useFactory config the microservice read autoFlushLogs from the factory's output, so a top-level autoFlushLogs: false was ignored. All flush sites now share flushLogsIfAutoFlushEnabled(), which reads the options passed to NestFactory.
---------
Co-authored-by: Kamil Myśliwiec <mail@kamilmysliwiec.com>
* fix(core): fail at startup for request-scoped class global enhancers
* test(core): rename the request-scoped global enhancer describes
---------
Co-authored-by: Kamil Myśliwiec <mail@kamilmysliwiec.com>
* fix(microservices): match rmq '#' wildcards in any position
* test(microservices): pin empty segment matching in rmq patterns
* fix(microservices): match empty rmq routing keys and stop on a mismatch
The broker splits an empty routing key into no words, so "#.#" matches it
as "#" does. The matcher also stops as soon as no prefix of the key can
match the pattern read so far.
---------
Co-authored-by: Kamil Myśliwiec <mail@kamilmysliwiec.com>
* fix(core): name the module when metadata entries are invalid
A custom provider without a usable useClass, useValue, useFactory or
useExisting, and an undefined entry in controllers or exports, crashed
bootstrap with a bare TypeError naming neither the module nor the token.
Throw a descriptive error instead, as undefined imports and providers
already do.
* test(core): cover the injectable path and the invalid provider message
Pin the paths the previous commit changed: a custom injectable without a
valid "use*" property, the message text for string, symbol and class
tokens, and null as well as undefined in the two container specs.