Skip to content

Commit 5cee083

Browse files
committed
fix(client-ofetch): return FormData when parseAs is formData
1 parent 7f2aa62 commit 5cee083

File tree

1 file changed

+2
-2
lines changed
  • packages/openapi-ts/src/plugins/@hey-api/client-ofetch/bundle

1 file changed

+2
-2
lines changed

packages/openapi-ts/src/plugins/@hey-api/client-ofetch/bundle/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@ export const parseSuccess = async (
379379
}
380380
}
381381

382-
// Prefer ofetch-populated data
382+
// Prefer ofetch-populated data unless we explicitly need raw `formData`
383383
let data: unknown = (response as any)._data;
384-
if (typeof data === 'undefined') {
384+
if (inferredParseAs === 'formData' || typeof data === 'undefined') {
385385
switch (inferredParseAs) {
386386
case 'arrayBuffer':
387387
case 'blob':

0 commit comments

Comments
 (0)