You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason is that the "query", "body" and "params" are processed after route middleware. So before action middlewares called, they are merged into req.$params, so you can modify through it, it will be the ctx.params.
Thanks for reply, with the help of view source code, I understood the internal.
I think the document description is not clear, which can make people mistakenly think that the use of the two middleware is the same, maybe should point out the difference?
When route-level middleware changed request body or query, action can get changed data, but if alias-level middleware changed it, it not work.
Here is a reproduce demo: after run
npm run dev
, then runcurl -X POST localhost:8080/test
, you can find the (maybe) bug.The text was updated successfully, but these errors were encountered: