(chunk, encoding, callback)
| 9 | } |
| 10 | |
| 11 | _transform(chunk, encoding, callback) { |
| 12 | if (chunk.length !== 0) { |
| 13 | this._transform = this.__transform; |
| 14 | |
| 15 | // Add Default Compression headers if no zlib headers are present |
| 16 | if (chunk[0] !== 120) { |
| 17 | // Hex: 78 |
| 18 | const header = Buffer.alloc(2); |
| 19 | header[0] = 120; // Hex: 78 |
| 20 | header[1] = 156; // Hex: 9C |
| 21 | this.push(header, encoding); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | this.__transform(chunk, encoding, callback); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | export default ZlibHeaderTransformStream; |
nothing calls this directly
no test coverage detected