summaryrefslogtreecommitdiff
path: root/desktop/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-10-27 22:29:56 +0200
committerRaindropsSys <raindrops@equestria.dev>2023-10-27 22:29:56 +0200
commit4d4308c46d4f7801c657cc79d2243e1a81831334 (patch)
treea2e392e0af92b9a3ca3d1b5afb841640276e2294 /desktop/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
parent9f9d66afebc59c6c265c4424f7b8fb36d8876541 (diff)
downloadmist-4d4308c46d4f7801c657cc79d2243e1a81831334.tar.gz
mist-4d4308c46d4f7801c657cc79d2243e1a81831334.tar.bz2
mist-4d4308c46d4f7801c657cc79d2243e1a81831334.zip
Updated 32 files, added 279 files, deleted 3 files and renamed 14 files (automated)
Diffstat (limited to 'desktop/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js')
-rw-r--r--desktop/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/desktop/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js b/desktop/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
new file mode 100644
index 0000000..d1791f0
--- /dev/null
+++ b/desktop/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
@@ -0,0 +1,28 @@
+"use strict";
+
+import stream from "stream";
+
+class ZlibHeaderTransformStream extends stream.Transform {
+ __transform(chunk, encoding, callback) {
+ this.push(chunk);
+ callback();
+ }
+
+ _transform(chunk, encoding, callback) {
+ if (chunk.length !== 0) {
+ this._transform = this.__transform;
+
+ // Add Default Compression headers if no zlib headers are present
+ if (chunk[0] !== 120) { // Hex: 78
+ const header = Buffer.alloc(2);
+ header[0] = 120; // Hex: 78
+ header[1] = 156; // Hex: 9C
+ this.push(header, encoding);
+ }
+ }
+
+ this.__transform(chunk, encoding, callback);
+ }
+}
+
+export default ZlibHeaderTransformStream;