diff options
| author | Curran McConnell <curran.mcconnell@protonmail.com> | 2023-09-07 23:41:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-08 09:11:33 +0530 |
| commit | a9cc4631ca4b5e2bb64943435d0d8242292b168d (patch) | |
| tree | 99bc1c8950c141d4c93ff964d2070a41bff5e1de /cli | |
| parent | 4a11603c76b13ecf92ce3141ec317a42ae9f8d1d (diff) | |
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.
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/tests/unit_node/zlib_test.ts | 7 |
1 files changed, 7 insertions, 0 deletions
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 }, |
