Repository navigation
Conversation
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 <sboettcher@ub313.net>
Contributor
|
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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