Skip to content

Commit cdf3701

Browse files
authoredMar 24, 2023
[fix] addsduplex option when sending a body
1 parent 3583ba0 commit cdf3701

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/fetch-wrapper.ts

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export default function fetchWrapper(
3939
body: requestOptions.body,
4040
headers: requestOptions.headers as HeadersInit,
4141
redirect: requestOptions.redirect,
42+
// duplex must be set if request.body is ReadableStream or Async Iterables.
43+
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
44+
...(requestOptions.body && { duplex: "half" }),
4245
},
4346
// `requestOptions.request.agent` type is incompatible
4447
// see https://github.com/octokit/types.ts/pull/264

0 commit comments

Comments
 (0)
Please sign in to comment.