Support compressed data packets with algorithm=uncompressed (#1085)
This commit is contained in:
parent
c4a7455cb5
commit
674e0217fc
|
@ -132,6 +132,10 @@ export default Compressed;
|
|||
|
||||
const nodeZlib = util.getNodeZlib();
|
||||
|
||||
function uncompressed(data) {
|
||||
return data;
|
||||
}
|
||||
|
||||
function node_zlib(func, options = {}) {
|
||||
return function (data) {
|
||||
return stream.nodeToWeb(stream.webToNode(data).pipe(func(options)));
|
||||
|
@ -170,6 +174,7 @@ if (nodeZlib) { // Use Node native zlib for DEFLATE compression/decompression
|
|||
};
|
||||
|
||||
decompress_fns = {
|
||||
uncompressed: uncompressed,
|
||||
zip: node_zlib(nodeZlib.createInflateRaw),
|
||||
zlib: node_zlib(nodeZlib.createInflate),
|
||||
bzip2: bzip2(Bunzip.decode)
|
||||
|
@ -181,6 +186,7 @@ if (nodeZlib) { // Use Node native zlib for DEFLATE compression/decompression
|
|||
};
|
||||
|
||||
decompress_fns = {
|
||||
uncompressed: uncompressed,
|
||||
zip: pako_zlib(pako.Inflate, { raw: true }),
|
||||
zlib: pako_zlib(pako.Inflate),
|
||||
bzip2: bzip2(Bunzip.decode)
|
||||
|
|
Loading…
Reference in New Issue
Block a user