http-fetch: missing file

This commit is contained in:
Koushik Dutta
2026-03-31 09:07:24 -07:00
parent 25bf83832a
commit a64dd8e878

View File

@@ -135,7 +135,7 @@ export function createHeadersArray(headers: HeadersInit | undefined): [string, s
*/
export function createStringOrBufferBody(headers: [string, string][], body: any) {
let contentType: string | undefined;
if (typeof body === 'object') {
if (typeof body === 'object' && !ArrayBuffer.isView(body)) {
body = JSON.stringify(body);
contentType = 'application/json';
}