From 892c51bed89f0201c54cd2a75e34671e4d4c2fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=9D=A8=E6=96=87?= Date: Sun, 25 Feb 2024 04:21:54 +0800 Subject: [PATCH] fix: duplex only has a getter --- src/request.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/request.ts b/src/request.ts index 94201a7..c99a088 100644 --- a/src/request.ts +++ b/src/request.ts @@ -13,7 +13,11 @@ export class Request extends GlobalRequest { } if (options?.body instanceof ReadableStream) { // node 18 fetch needs half duplex mode when request body is stream - ;(options as any).duplex = 'half' + Object.defineProperty(options, "duplex", { + get() { + return "half"; + } + }) } super(input, options) }