From a9cc4631ca4b5e2bb64943435d0d8242292b168d Mon Sep 17 00:00:00 2001 From: Curran McConnell Date: Thu, 7 Sep 2023 23:41:33 -0400 Subject: fix(ext/node/ops/zlib/brotli): Allow decompressing more than 4096 bytes (#20301) Fixes https://github.com/denoland/deno/issues/19816 In that issue, I suggest switching over the other brotli functionality to the Rust API provided by the `brotli` crate. Here, I only do that with the `brotli_decompress` function to fix the bug with buffers longer than 4096 bytes. --- cli/tests/unit_node/zlib_test.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cli/tests/unit_node') diff --git a/cli/tests/unit_node/zlib_test.ts b/cli/tests/unit_node/zlib_test.ts index 6b09c50b0..b878b7cc3 100644 --- a/cli/tests/unit_node/zlib_test.ts +++ b/cli/tests/unit_node/zlib_test.ts @@ -62,6 +62,13 @@ Deno.test("brotli compression", async () => { } }); +Deno.test("brotli end-to-end with 4097 bytes", () => { + const a = "a".repeat(4097); + const compressed = brotliCompressSync(a); + const decompressed = brotliDecompressSync(compressed); + assertEquals(decompressed.toString(), a); +}); + Deno.test( "zlib create deflate with dictionary", { sanitizeResources: false }, -- cgit v1.2.3