Closed Sleepful closed 3 years ago
When using validate as joi validation, the ctx.request.rawBody cannot be accessed by middleware down the line.
validate
However, if I remove the validate portion of a route (with the Joi.validations()), I am able to access ctx.request.rawBody just fine.
Joi.validations()
What gives? I'd like to have joi validation but also access to ctx.request.rawBody, is the library removing it from the request object?
Most likely related to https://github.com/koajs/joi-router/issues/63
ctx.request.rawBody can be accessed before joi validation through pre key, which was added in https://github.com/koajs/joi-router/pull/66
ctx.request.rawBody
pre
When using
validate
as joi validation, the ctx.request.rawBody cannot be accessed by middleware down the line.However, if I remove the
validate
portion of a route (with theJoi.validations()
), I am able to access ctx.request.rawBody just fine.What gives? I'd like to have joi validation but also access to ctx.request.rawBody, is the library removing it from the request object?