Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastify adapter not triggering middleware when query parameter is present #1474

Closed
josec89 opened this issue Jan 28, 2019 · 4 comments

Comments

@josec89
Copy link

commented Jan 28, 2019

I'm submitting a...


[ ] Regression 
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Middelware is not triggered when using FastifyAdapter and the url includes query params.

/dosomething --> Middleware is called
/dosomething? --> Middleware is not called
/dosomething?pid=1406 --> Middleware is not called

Expected behavior

Middleware should be called regardless the query parameters involved

Minimal reproduction of the problem with instructions

  1. Use FastifyAdapter
  2. Create a middleware and a controller
  3. Make use of that middleware in all the routes of that controller
    configure(consumer: MiddlewareConsumer) {
        consumer
            .apply(UserMiddleware)
            .forRoutes(MyController)
      }
  1. Call one endpoint in that controller with and without query params.

/dosomething --> Middleware is called
/dosomething? --> Middleware is not called
/dosomething?pid=1406 --> Middleware is not called

Environment


Nest version: 5.6.2

 
For Tooling issues:
- Node version: v10.15.0  
- Platform: Mac  

Others:

@Tsury

This comment has been minimized.

Copy link

commented Feb 26, 2019

Seems to be related to an issue with Nest and FastifyAdapter in general, not necessarily related to query parameters
#972 (comment)

@josec89

This comment has been minimized.

Copy link
Author

commented Feb 28, 2019

@Tsury I'll try to reproduce the error again with the latest version, hope it's indeed fixed :) 🤞

@kamilmysliwiec

This comment has been minimized.

Copy link
Member

commented Mar 9, 2019

It should be fixed in 5.7.4

@Suvitruf

This comment has been minimized.

Copy link

commented Jul 22, 2019

Have this issue in 6.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.