fix: allow posting empty key files in multipart/form-data (#2664)
This commit is contained in:
@@ -250,7 +250,7 @@ watch(
|
||||
workingParams.value,
|
||||
A.filterMap(
|
||||
flow(
|
||||
O.fromPredicate((e) => e.entry.key !== ""),
|
||||
O.fromPredicate((e) => e.entry.key !== "" || e.entry.isFile),
|
||||
O.map((e) => e.entry)
|
||||
)
|
||||
)
|
||||
@@ -271,7 +271,7 @@ watch(workingParams, (newWorkingParams) => {
|
||||
newWorkingParams,
|
||||
A.filterMap(
|
||||
flow(
|
||||
O.fromPredicate((e) => e.entry.key !== ""),
|
||||
O.fromPredicate((e) => e.entry.key !== "" || e.entry.isFile),
|
||||
O.map((e) => e.entry)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -254,7 +254,7 @@ function getFinalBodyFromRequest(
|
||||
if (request.body.contentType === "multipart/form-data") {
|
||||
return pipe(
|
||||
request.body.body,
|
||||
A.filter((x) => x.key !== "" && x.active), // Remove empty keys
|
||||
A.filter((x) => (x.key !== "" || x.isFile) && x.active), // Remove empty keys
|
||||
|
||||
// Sort files down
|
||||
arraySort((a, b) => {
|
||||
|
||||
Reference in New Issue
Block a user