Skip to content

Commit d84814c

Browse files
Fix: define duplex option on non-null body on infra open-api client fetch (e2b-dev#81)
Since we replace the infra openapi clients fetch function with next.js native fetch, and the open-api client always passes bodies as `ReadableStream`, we have to set `duplex: "half"` on the overridden fetch client when body is defined. Fixes e2b-dev#80
1 parent 876a3d8 commit d84814c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/lib/clients/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const infra = createClient<InfraPaths>({
88
headers,
99
body,
1010
method,
11+
duplex: !!body ? 'half' : undefined,
1112
...options,
1213
})
1314
},

0 commit comments

Comments
 (0)