Broker middleware call
wrapper removes context data. Cannot use ctx.meta.
#1241
Labels
call
wrapper removes context data. Cannot use ctx.meta.
#1241
Prerequisites
Current Behavior
When using a custom middleware in broker, specially when defing a
call
wrapper exactly the way the official documentation indicates, context data appears to be removed.For example, moleculer-web's
context.meta.$statusCode
doesn't work when defining the middleware.If you remove the middleware, everything works fine.
Expected Behavior
Context data should be there after calling the action.
moleculer-web's
context.meta.$statusCode
should work even with middlewares.Failure Information
Steps to Reproduce
call
wrapper as a custom middleware exactly the way the official documentation indicatesctx.meta
between actions, such as settingctx.meta.$statusCode
using moleculer-webTake a look at the repro steps below.
Reproduce code
Code is reproduced under this repro repo.
npm install && npm run dev
curl --location 'localhost:4987/api/statusCodeTest/testNotFound' -I
You will see an HTTP 200 instead an HTTP 404 as defined in
statusCode.service.ts
action.Context
0.14.31
19.7.0
Ubuntu 22.04
The text was updated successfully, but these errors were encountered: