File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -101,12 +101,12 @@ function newWritableStreamFromStreamWritable(streamWritable) {
101
101
// here because it will return false if streamWritable is a Duplex
102
102
// whose writable option is false. For a Duplex that is not writable,
103
103
// we want it to pass this check but return a closed WritableStream.
104
- const checkIfWritable =
104
+ // We check if the given stream is a stream.Writable or http.OutgoingMessage
105
+ const checkIfWritableOrOutgoingMessage =
105
106
streamWritable &&
106
107
typeof streamWritable ?. write === 'function' &&
107
- typeof streamWritable ?. on === 'function' &&
108
- ! streamWritable ?. _readableState ;
109
- if ( ! checkIfWritable ) {
108
+ typeof streamWritable ?. on === 'function' ;
109
+ if ( ! checkIfWritableOrOutgoingMessage ) {
110
110
throw new ERR_INVALID_ARG_TYPE (
111
111
'streamWritable' ,
112
112
'stream.Writable' ,
You can’t perform that action at this time.
0 commit comments