fix: request failing on change content type to multipart-formdata (#3922)

Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
This commit is contained in:
Anwarul Islam
2024-03-22 18:41:16 +06:00
committed by GitHub
parent ba8c4480d9
commit 6f4455ba03
2 changed files with 4 additions and 3 deletions

View File

@@ -274,7 +274,7 @@ function getFinalBodyFromRequest(
if (request.body.contentType === "application/x-www-form-urlencoded") {
const parsedBodyRecord = pipe(
request.body.body,
request.body.body ?? "",
parseRawKeyValueEntriesE,
E.map(
flow(
@@ -311,7 +311,7 @@ function getFinalBodyFromRequest(
if (request.body.contentType === "multipart/form-data") {
return pipe(
request.body.body,
request.body.body ?? [],
A.filter((x) => (x.key !== "" || x.isFile) && x.active), // Remove empty keys
// Sort files down