From 44c0385b041a444459d5247fa0af37c4c5070252 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 26 Oct 2017 12:32:23 +0200 Subject: [PATCH] doc: more accurate zlib windowBits information Fixes: https://github.com/nodejs/node/issues/14847 PR-URL: https://github.com/nodejs/node/pull/16511 Backport-PR-URL: https://github.com/nodejs/node/pull/16623 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson Reviewed-By: Refael Ackermann --- doc/api/zlib.md | 11 +++++------ test/parallel/test-zlib.js | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/api/zlib.md b/doc/api/zlib.md index e6972c8dad6ea4..6cef23824977c9 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -423,12 +423,11 @@ added: v0.5.8 Returns a new [DeflateRaw][] object with an [options][]. *Note*: An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when windowBits -is set to 8 for raw deflate streams. zlib does not have a working implementation -of an 8-bit Window for raw deflate streams and would automatically set windowBit -to 9 if initially set to 8. Newer versions of zlib will throw an exception. -This creates a potential DOS vector, and as such the behavior has been reverted -in Node.js 8, 6, and 4. Node.js version 9 and higher will throw when windowBits -is set to 8. +is set to 8 for raw deflate streams. zlib would automatically set windowBits +to 9 if was initially set to 8. Newer versions of zlib will throw an exception, +so Node.js restored the original behavior of upgrading a value of 8 to 9, +since passing `windowBits = 9` to zlib actually results in a compressed stream +that effectively uses an 8-bit window only. ## zlib.createGunzip([options])