Skip to content

Commit fe00d71

Browse files
authored
Merge pull request #22 from Chuiantw1212/bug-15&18
set duplex to 'half'
2 parents c217fee + f51eaee commit fe00d71

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/index.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ export const nodeRequestToWebstand = (
6363
return _signal
6464
},
6565
// @ts-expect-error
66-
// ? https://github.com/nodejs/node/issues/46221#issuecomment-1426707013
67-
duplex: 'content-length' in req.headers ? true : undefined
66+
duplex: 'half'
6867
})
6968
}
7069

@@ -349,10 +348,10 @@ export const node = () => {
349348
typeof options === 'number'
350349
? options
351350
: {
352-
...options,
353-
// @ts-ignore
354-
host: options?.hostname
355-
},
351+
...options,
352+
// @ts-ignore
353+
host: options?.hostname
354+
},
356355
() => {
357356
const address = server.address()
358357
const hostname =
@@ -409,10 +408,10 @@ export const node = () => {
409408
typeof options === 'number'
410409
? options
411410
: {
412-
...options,
413-
// @ts-ignore
414-
host: options?.hostname
415-
}
411+
...options,
412+
// @ts-ignore
413+
host: options?.hostname
414+
}
416415
)
417416
},
418417
requestIP() {
@@ -448,10 +447,10 @@ export const node = () => {
448447
typeof options === 'object'
449448
? (options as any)
450449
: {
451-
port: options
452-
}
450+
port: options
451+
}
453452
)
454-
} catch {}
453+
} catch { }
455454
})
456455
}
457456
)

0 commit comments

Comments
 (0)