Skip to content

Commit 0c9b276

Browse files
committed
fix: resolve formdata as buffer
cont. 3757072
1 parent baf37e5 commit 0c9b276

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/utils/body.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,14 @@ export function readRawBody<E extends Encoding = "utf8">(
9696
return Buffer.from(_resolved.toString());
9797
}
9898
if (_resolved instanceof FormData) {
99-
return new Response(_resolved).bytes();
99+
return new Response(_resolved)
100+
.bytes()
101+
.then((uint8arr) => Buffer.from(uint8arr));
100102
}
101103
return Buffer.from(_resolved);
102104
});
103105
return encoding
104-
? promise.then((buff) => buff.toString(encoding))
106+
? (promise.then((buff) => buff.toString(encoding)) as Promise<any>)
105107
: (promise as Promise<any>);
106108
}
107109

0 commit comments

Comments
 (0)