adonis-fullstack-app icon indicating copy to clipboard operation
adonis-fullstack-app copied to clipboard

Middleware socket needn't wait next()?

Open phambinh217 opened this issue 6 years ago • 0 comments

Dear, I created a middleware

'use strict'

class CustomMiddleware {
  // for HTTP
  async handle (ctx, next) {
   // no call next() function()
  }

  // for WebSocket
  async wsHandle (ctx, next) {
   // no call next() function
  }
}

module.exports = CustomMiddleware

When I use this middleware for http request, the request never go to my controller because I don't call the next() function on handle(). But the socket request doesn't same, it still go to my controller. Is it a bug, or what am I doing wrong?

I using adonisjs 4.1. my node version is 10.x

phambinh217 avatar Mar 30 '19 01:03 phambinh217