Closed manuscriptmastr closed 7 years ago
Need tests for lines 58 and 211. Please add or tweak the tests :)
Thanks for the PR in any way.
Done. Added a test for a field with three values and removed the unused utils.parseQs function.
Yea, it's better now :) Services are green too. Thanks.
👍 thanks!
So looks like that bit of code that rebuilt a query string then reparsed was causing issues. I pulled the fields straight from IncomingForm, then handled the edge cases of (1) a field that already has a value and (2) a field that is already an array of values. To make sure file-related fields took precedence, I separated regular fields from file fields, then Object.assign()ed them to the fields property when finished.
Tests all pass and works perfectly on my site now.
Closes https://github.com/tunnckoCore/koa-better-body/issues/80