fix: try avoid duplex error

This commit is contained in:
wener 2023-04-04 11:30:28 +08:00
parent 20738d9deb
commit d94d6f75cd
No known key found for this signature in database

View File

@ -55,7 +55,8 @@ export function createFetchWithProxyByNextUndici({
let agent: any;
return async (...args) => {
const init = (args[1] ||= {});
if (init.body instanceof ReadableStream) {
// better check instanceof ReadableStream
if (init.body) {
// https://github.com/nodejs/node/issues/46221
(init as any).duplex ||= "half";
}