Skip to content

Commit 5d89b9a

Browse files
committed
fix bun issue
1 parent 8e02a1b commit 5d89b9a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/openapi-fetch/src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ export default function createClient<Paths extends {}>(clientOptions: ClientOpti
6868

6969
// parse response (falling back to .text() when necessary)
7070
if (response.ok) {
71-
let data: any = response.body;
71+
let data: any;
7272
if (parseAs !== "stream") {
7373
const cloned = response.clone();
7474
data = typeof cloned[parseAs] === "function" ? await cloned[parseAs]() : await cloned.text();
75+
} else {
76+
data = response.clone().body;
7577
}
7678
return { data, response: response as any };
7779
}

0 commit comments

Comments
 (0)