Skip to content

Commit fb3c085

Browse files
committed
set duplex to 'half'
According to the message RequestInit: duplex option is required when sending a body
1 parent ff76f8e commit fb3c085

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const nodeRequestToWebstand = (
6363
return _signal
6464
},
6565
// @ts-expect-error
66-
duplex: 'content-type' in req.headers ? 'half' : undefined
66+
duplex: 'half'
6767
})
6868
}
6969

@@ -348,10 +348,10 @@ export const node = () => {
348348
typeof options === 'number'
349349
? options
350350
: {
351-
...options,
352-
// @ts-ignore
353-
host: options?.hostname
354-
},
351+
...options,
352+
// @ts-ignore
353+
host: options?.hostname
354+
},
355355
() => {
356356
const address = server.address()
357357
const hostname =
@@ -408,10 +408,10 @@ export const node = () => {
408408
typeof options === 'number'
409409
? options
410410
: {
411-
...options,
412-
// @ts-ignore
413-
host: options?.hostname
414-
}
411+
...options,
412+
// @ts-ignore
413+
host: options?.hostname
414+
}
415415
)
416416
},
417417
requestIP() {
@@ -447,10 +447,10 @@ export const node = () => {
447447
typeof options === 'object'
448448
? options as any
449449
: {
450-
port: options
451-
}
450+
port: options
451+
}
452452
)
453-
} catch {}
453+
} catch { }
454454
})
455455
}
456456
)

0 commit comments

Comments
 (0)