MCPcopy Create free account
hub / github.com/axios/axios / _transform

Method _transform

lib/helpers/ZlibHeaderTransformStream.js:11–26  ·  view source on GitHub ↗
(chunk, encoding, callback)

Source from the content-addressed store, hash-verified

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
29export default ZlibHeaderTransformStream;

Callers

nothing calls this directly

Calls 1

__transformMethod · 0.95

Tested by

no test coverage detected