Open LvChengbin opened 6 years ago
Just like the code in koa-bodyparser https://github.com/koajs/bodyparser/blob/master/index.js#L72
koa-bodyparser
return async function bodyParser(ctx, next) { if (ctx.request.body !== undefined) return await next(); if (ctx.disableBodyParser) return await next(); }
Without checking it, koa-body will make requests be pending there if the raw body has already been parsed by other middleware because the Promise cannot be resolved in https://github.com/dlau/koa-body/blob/master/index.js#L84
koa-body
pending
Promise
This could be potentially breaking behavior but I'd accept a PR adding this for the next major version.
Just like the code in
koa-bodyparser
https://github.com/koajs/bodyparser/blob/master/index.js#L72Without checking it,
koa-body
will make requests bepending
there if the raw body has already been parsed by other middleware because thePromise
cannot be resolved in https://github.com/dlau/koa-body/blob/master/index.js#L84