Closed makbari closed 8 months ago
URL doesn't work (sandbox)
URL doesn't work (sandbox)
please re-open the page again and try to access the https://4wrsdk-3000.csb.app/api/hello
in preview page.
My issue is not about that (https://github.com/nestjs/nest/issues/13318), but as I'm using a middleware, I can confirm that it's executed twice in my reproduction.
from what I've tested this bug exists since @nestjs/core
10.2 and probably older versions
Do you guys want to investigate it further? maybe you can start from packages/core/middleware/route-info-path-extractor.ts
file
Let's track this here https://github.com/nestjs/nest/pull/11832
Is there an existing issue for this?
Current behavior
exclude a path in
setGlobalPrefix
cause middleware to trigger twice. now, calling/api/hello
will trigger theLoggerMiddleware
to call twice.without
exclude: ['/']
, works as expected.Minimum reproduction code
https://codesandbox.io/p/sandbox/hopeful-pare-4wrsdk
Steps to reproduce
No response
Expected behavior
It should only call the logger middleware once
Package
Other package
No response
NestJS version
10.3.3
Packages versions
Node.js version
No response
In which operating systems have you tested?
Other
No response