Closed SilentAntenna closed 5 years ago
Thanks for the report and sorry you hit an issue.
@zevisert, could you weigh in on this?
Spot on report - I saw the title and realized right away it was that line, my bad. I guess I was going under the assumption that co-body
was returning an empty object rather than undefined
. I'll shoot you a PR later today.
Much appreciated @zevisert !
Many thanks. I forgot to close this issue, sorry.
Problem/Feature Request Summary
Environment Information
Current Behavior
If options.includeUnparsed is set, line 106/119 in index.js will always be executed:
ctx.request.body[symbolUnparsed] = body.raw;
which may trigger an exception when the request doesn't have a body and
ctx.request.body[symbolUnparsed]
is undefined.Possible Solution
fix line 105/118 like this:
if (body.parsed && ! ctx.is('text')) {