Spaces:
Sleeping
Sleeping
Download node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js from omnitool-ai/omnitool_on_hf: direct link, hf CLI and curl.
- Browser
- Download file 681 Bytes
-
https://huggingface.co/spaces/omnitool-ai/omnitool_on_hf/resolve/main/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
- Command line
-
hf download hf://spaces/omnitool-ai/omnitool_on_hf/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
-
curl -L -o ZlibHeaderTransformStream.js https://huggingface.co/spaces/omnitool-ai/omnitool_on_hf/resolve/main/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
681 Bytes
| ; | |
| 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; | |