Closed Chunlin-Li closed 7 years ago
This is because https://gist.github.com/Chunlin-Li/1f013483dff79f630cf3c92d9c2b1277#file-index-js-L10 listen on data event before raw-body, it isn't a recommended usage, I'll add ctx.request.rawBody
to access the raw body later.
@dead-horse Thanks for your suggestion! I really need the rawBody access.
Just wanted to report this broke our commercial app, too (over 100k+ users). We were just using vanilla koa-bodyparser with nothing special. Latest release seems to have fixed the issue.
After co-body update to v5.0.3, my program can not work as usual. I see a Error below:
You can reproduce the problem by this script: https://gist.github.com/Chunlin-Li/1f013483dff79f630cf3c92d9c2b1277
The commit of v5.0.3, move the
raw(inflate(req), opts);
to the Promise chain. this will delay the raw-body execute, and the first onData event will lost. The v5.0.2 works well.node version: 7.6.2 koa version: 1.4.0 koa-bodyparser version: 2.4.0