diff --git a/lib/zlib/deflate.js b/lib/zlib/deflate.js index b932d31f..7165d025 100644 --- a/lib/zlib/deflate.js +++ b/lib/zlib/deflate.js @@ -1589,6 +1589,9 @@ const deflate = (strm, flush) => { } /* Write the header */ + if (s.status === INIT_STATE && s.wrap === 0) { + s.status = BUSY_STATE; + } if (s.status === INIT_STATE) { /* zlib header */ let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;