mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
committed by
GitHub
parent
bb2dd0e90c
commit
3e14cfbbcf
@@ -35,13 +35,16 @@ class CompressionStream {
|
||||
#transform;
|
||||
|
||||
/**
|
||||
* @param {'deflate'|'gzip'} format
|
||||
* @param {'deflate'|'deflate-raw'|'gzip'} format
|
||||
*/
|
||||
constructor(format) {
|
||||
switch (format) {
|
||||
case 'deflate':
|
||||
this.#handle = lazyZlib().createDeflate();
|
||||
break;
|
||||
case 'deflate-raw':
|
||||
this.#handle = lazyZlib().createDeflateRaw();
|
||||
break;
|
||||
case 'gzip':
|
||||
this.#handle = lazyZlib().createGzip();
|
||||
break;
|
||||
@@ -80,13 +83,16 @@ class DecompressionStream {
|
||||
#transform;
|
||||
|
||||
/**
|
||||
* @param {'deflate'|'gzip'} format
|
||||
* @param {'deflate'|'deflate-raw'|'gzip'} format
|
||||
*/
|
||||
constructor(format) {
|
||||
switch (format) {
|
||||
case 'deflate':
|
||||
this.#handle = lazyZlib().createInflate();
|
||||
break;
|
||||
case 'deflate-raw':
|
||||
this.#handle = lazyZlib().createInflateRaw();
|
||||
break;
|
||||
case 'gzip':
|
||||
this.#handle = lazyZlib().createGunzip();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user