Skip to content

Commit

Permalink
Fix deflateEnd() to not report an error at start of raw deflate.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlidwka committed Jun 10, 2022
1 parent 4dd6658 commit 8a1cdad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/zlib/deflate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8a1cdad

Please sign in to comment.