Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ext/node): flush brotli decompression stream #22856

Merged
merged 2 commits into from Mar 12, 2024

Conversation

littledivy
Copy link
Member

Fixes #22259

The decompressed input size was not restored because of improper flushing of the CBrotliDecompressStream state.

Fixes denoland#22259

The decompressed input size was not restored because of improper flushing of the CBrotliDecompressStream state.
@littledivy littledivy changed the title fix: flush brotli decompression stream fix(ext/node): flush brotli decompression stream Mar 12, 2024
Comment on lines +175 to +183
Deno.test("brotli decompress flush restore size", async () => {
const input = new Uint8Array(1000000);
const output = await buffer(
Readable.from([input])
.pipe(createBrotliCompress())
.pipe(createBrotliDecompress()),
);
assertEquals(output.length, input.length);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed this test fails on main

@littledivy littledivy merged commit 4a88695 into denoland:main Mar 12, 2024
17 checks passed
@littledivy littledivy deleted the brotli_decompress_flush branch March 12, 2024 11:53
nathanwhit pushed a commit that referenced this pull request Mar 14, 2024
Fixes #22259

The decompressed input size was not restored because of improper
flushing of the CBrotliDecompressStream state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node:zlib brotli compression stream truncates data
2 participants