Files
rspade_system/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
root 3ed8517b2a Framework updates
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 23:20:19 +00:00

30 lines
688 B
JavaScript
Executable File

'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;