diff --git a/lib/internal/streams/end-of-stream.js b/lib/internal/streams/end-of-stream.js index 1550259d02de00..274c2796edd443 100644 --- a/lib/internal/streams/end-of-stream.js +++ b/lib/internal/streams/end-of-stream.js @@ -157,13 +157,13 @@ function eos(stream, options, callback) { } else if ( !readable && (!willEmitClose || isReadable(stream)) && - writableFinished + (writableFinished || !isWritable(stream)) ) { process.nextTick(onclose); } else if ( !writable && (!willEmitClose || isWritable(stream)) && - readableFinished + (readableFinished || !isReadable(stream)) ) { process.nextTick(onclose); } else if ((rState && stream.req && stream.aborted)) {