Skip to content

Commit 3757072

Browse files
committed
fix: use Response.bytes to normalize FormData
1 parent f38dd03 commit 3757072

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/body.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,12 @@ export function readRawBody<E extends Encoding = "utf8">(
9292
}
9393
// TODO: Handle other BodyInit types
9494
// https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#body
95-
if (_resolved instanceof URLSearchParams || _resolved instanceof FormData) {
95+
if (_resolved instanceof URLSearchParams) {
9696
return Buffer.from(_resolved.toString());
9797
}
98+
if(_resolved instanceof FormData) {
99+
return new Response(_resolved).bytes();
100+
}
98101
return Buffer.from(_resolved);
99102
});
100103
return encoding

0 commit comments

Comments
 (0)