Skip to content

Commit

Permalink
fix: multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
izatop committed Dec 5, 2022
1 parent c2b1327 commit 7beaa5b
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions packages/app/src/TransformRequest/MultipartFormDataTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,12 @@ export const MultipartFormDataTransform = async <T = unknown>(request: IRequest)
.pipe(createWriteStream(tmpname))
.on("close", () => def.resolve());
})
.on("field", (name, value, info) => {
if (info.mimeType === "application/json") {
try {
inject(parseFieldName(name), JSON.parse(value), result);
} catch {
// skip
}

return;
.on("field", (name, value) => {
try {
inject(parseFieldName(name), JSON.parse(value), result);
} catch {
// skip
}

inject(parseFieldName(name), value, result);
})
.on("close", () => defer.resolve());

Expand Down

0 comments on commit 7beaa5b

Please sign in to comment.