Closed felixsanz closed 5 years ago
can you provide the version and the minimum reproduce code?
it is ok in the test case: https://github.com/koajs/bodyparser/blob/master/test/middleware.test.js#L39
The version is latest, 4.2.0
.
The code... I sent a string compressed with gzip to koa, and the body
had the string decompressed, but the rawBody
had nothing (console.log it was giving me an empty new line). I was expecting a buffer (raw bytes of the compressed body)
it will happen when no enableTypes matched in koa-bodyparser module
@i5ting do you think its normal ? If for some reason bodyparser cant parse a format, why would it doesnt put it inside rawBody ?
I'm also getting undefined for rawBody.
Same here. Parsed result was correctly presented, which means one of the enableTypes was hit, right?
Happens to me.
I found that the request body is text; and the parser doesn't process text on default.
The parser provided "enableTypes" option so that I can let it process text body.
app.use(bodyParser({
"enableTypes": ['json', 'form', 'text'],
}));
I parsed the body and it works, but if i dump the rawBody i get nothing.
the order was: