232
followRedirects: followRedirects - 1
233
}, token).then(resolve, reject);
235
>
let stream: streams.ReadableStreamEvents<Uint8Array> = res;
236
>
237
>
// Responses from Electron net module should be treated as response
238
>
// from browser, which will apply gzip filter and decompress the response
239
>
// using zlib before passing the result to us. Following step can be bypassed
240
>
// in this case and proceed further.
241
>
// Refs https://source.chromium.org/chromium/chromium/src/+/main:net/url_request/url_request_http_job.cc;l=1266-1318
242
>
if (!options.isChromiumNetwork && res.headers['content-encoding'] === 'gzip') {
243
stream = res.pipe(createGunzip());
244
}
246
>
resolve({ res, stream: streamToBufferReadableStream(stream) } satisfies IRequestContext);
247
>
}
248
});
249