Middleware not executed when using exclude
in setGlobalPrefix
#13401
Labels
needs triage
This issue has not been looked into
exclude
in setGlobalPrefix
#13401
Is there an existing issue for this?
Current behavior
In versions 10.3.4+, if using
exclude
insetGlobalPrefix
, e.g.Then middleware stops being executed at all (any sort of middleware).
For reproduction see tests in https://github.com/xtrinch/nestjs-middleware-issue-demo
Minimum reproduction code
https://github.com/xtrinch/nestjs-middleware-issue-demo
Steps to reproduce
yarn test
, observe that the tests do not pass - middleware should attach a header to requestexclude
param fromsetGlobalPrefix
Expected behavior
Middleware should run regardless of exclude in
setGlobalPrefix
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
10.3.4+
Packages versions
Node.js version
18
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: