Repository navigation
doc: clarify cumulative output limits for zlib streams - #67373
Conversation
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
This comment was marked as resolved.
This comment was marked as resolved.
f7c3c22 to
31b680e
Compare
Commit Queue failedThe pull request was removed from the Commit Queue and labeled
commit-queue-failed
Full Commit Queue output |
|
There are two different GitHub users involved here: https://github.com/sboettcher-ub313 committed and signed This is causing landing checks to fail. |
Clarify in `doc/api/zlib.md` that `maxOutputLength` bounds single-call convenience methods (`zlib.gunzip()`, `zlib.brotliDecompress()`, `zlib.zstdDecompress()`, and `*Sync` variants) rather than cumulative decoded output across `create*Decompress()` streams, and add a `stream/promises` `pipeline()` example enforcing a cumulative byte limit. Signed-off-by: Sophia Boettcher <93076268+sboettch@users.noreply.github.com>
31b680e to
b11a65b
Compare
|
thank you @MikeMcC399, and i am really sorry for the mix-up and the extra Commit Queue trouble.. the amended commit's thanks, sophia! |
|
Landed in f551bb5 |
|
Thank you for correcting the commit! The PR has now landed successfully! I'm sorry for my typo referring to a completely different user https://github.com/sboettcher ! I corrected that above. |
|
thank you so much @MikeMcC399 for catching the commit-queue issue and helping with this! thanks for all your hard work defending the internet! |
Clarify in `doc/api/zlib.md` that `maxOutputLength` bounds single-call convenience methods (`zlib.gunzip()`, `zlib.brotliDecompress()`, `zlib.zstdDecompress()`, and `*Sync` variants) rather than cumulative decoded output across `create*Decompress()` streams, and add a `stream/promises` `pipeline()` example enforcing a cumulative byte limit. Signed-off-by: Sophia Boettcher <93076268+sboettch@users.noreply.github.com> PR-URL: #67373 Refs: https://github.com/nodejs/node/blob/main/doc/api/zlib.md Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Refs: https://github.com/nodejs/node/blob/main/doc/api/zlib.md
Hello
nodejs/nodedocumentation maintainers, and thank you for maintaining thenode:zlibAPI reference acrossgzip,brotli, andzstd. I am a citizen applied data scientist working on WebHealth (an open public-interest security observatory), and while testing streaming decompression configurations locally across Node.js runtimes, I noticed a small point indoc/api/zlib.mdwhere clarifying howmaxOutputLengthinteracts with streaming decompressors could help callers bound memory safely.doc/api/zlib.mddocumentsmaxOutputLengthunderClass: Options,Class: BrotliOptions, andClass: ZstdOptionsfor single-buffer convenience methods (zlib.gunzip(),zlib.brotliDecompress(),zlib.zstdDecompress(), and their*Synccounterparts). On Node.jsv22.x,v24.x, andv26.5.0, passing{ maxOutputLength }to streaming factories (zlib.createGunzip(),zlib.createBrotliDecompress(),zlib.createZstdDecompress()) bounds per-chunk internal buffer growth rather than cumulative decoded stream output across chunks (RFC 1952/RFC 7932/RFC 8878,CWE-409).Clarify in
doc/api/zlib.md(Class: Options,Class: BrotliOptions, andClass: ZstdOptions) thatmaxOutputLengthcaps total output on convenience methods rather than cumulative stream output acrosscreate*Decompress()streams, and document anode:stream/promisespipeline()+Transformbyte-counter pattern that aborts streaming decompression and destroys the upstreamReadableas soon as a cumulative byte limit is exceeded.Validation:
doc/api/zlib.mdline wrapping (<= 80columns), reference links ([convenience methods][],[pipeline()][],[stream.Transform][]), and whitespace (git diff --check) with zero warnings.pipeline()+Transformguard acrosscreateGunzip(),createBrotliDecompress(), andcreateZstdDecompress()at exact65,536B (OK) and65,537B (RangeError+source.destroyed === true).Thank you very much for your time and review. If a shorter inline note under
maxOutputLengthor a different location indoc/api/zlib.mdfits the documentation style better, I am happy to adjust this however you prefer.Warm regards,
Sophia Boettcher