deepkit-framework icon indicating copy to clipboard operation
deepkit-framework copied to clipboard

Middlewares are not applied when specifying multiple matching routes

Open NexZhu opened this issue 3 years ago • 0 comments

Middlewares are not applied when specifying multiple matching routes:

This won't work:

  middlewares: [
    httpMiddleware.for(SomeMiddleware).forRoutes({
      path: '/pathA',
    },
    {
      path: 'pathB',
    }),
  ]

While this works:

  middlewares: [
    httpMiddleware.for(SomeMiddleware).forRoutes({
      path: '/pathA',
    }),
    httpMiddleware.for(SomeMiddleware).forRoutes({
      path: 'pathB',
    }),
  ]

Haven't found the related code yet but I guess it's similar cause to this issue (and logic is used instead of or logic in matching) https://github.com/deepkit/deepkit-framework/issues/284

NexZhu avatar Aug 11 '22 06:08 NexZhu