stream: add support for deflate-raw format to webstreams compression

this change makes `deflate-raw` a valid parameter for both
CompressionStream and DecompressionStream constructors

it makes node's implementation consistent with what modern browsers
support and what specification calls for

see: https://wicg.github.io/compression/#compression-stream
PR-URL: https://github.com/nodejs/node/pull/50097
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
This commit is contained in:
Damian Krzeminski authored and GitHub committed 2023-11-09 11:18:57 +00:00
1 parent bb2dd0e90c
commit 3e14cfbbcf
3 files changed
+19 -5

No files matched your search

@@ -38,7 +38,7 @@ async function test(format) {
]);
}
Promise.all(['gzip', 'deflate'].map((i) => test(i))).then(common.mustCall());
Promise.all(['gzip', 'deflate', 'deflate-raw'].map((i) => test(i))).then(common.mustCall());
[1, 'hello', false, {}].forEach((i) => {
assert.throws(() => new CompressionStream(i), {