From fb3c08564c98d6bea9e112457e6d620f60ca8caa Mon Sep 17 00:00:00 2001 From: EN Chu Date: Sat, 25 Jan 2025 20:00:00 +0800 Subject: [PATCH] set duplex to 'half' According to the message RequestInit: duplex option is required when sending a body --- src/index.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/index.ts b/src/index.ts index c1f936b..13bc80b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -63,7 +63,7 @@ export const nodeRequestToWebstand = ( return _signal }, // @ts-expect-error - duplex: 'content-type' in req.headers ? 'half' : undefined + duplex: 'half' }) } @@ -348,10 +348,10 @@ export const node = () => { typeof options === 'number' ? options : { - ...options, - // @ts-ignore - host: options?.hostname - }, + ...options, + // @ts-ignore + host: options?.hostname + }, () => { const address = server.address() const hostname = @@ -408,10 +408,10 @@ export const node = () => { typeof options === 'number' ? options : { - ...options, - // @ts-ignore - host: options?.hostname - } + ...options, + // @ts-ignore + host: options?.hostname + } ) }, requestIP() { @@ -447,10 +447,10 @@ export const node = () => { typeof options === 'object' ? options as any : { - port: options - } + port: options + } ) - } catch {} + } catch { } }) } )