Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (resource: WebResource, next: any, callback: any): any => {
return requestPipeline.interimStream((input: Readable, output: Writable) => {
input.pause();
if (telemetryIsEnabled) {
resource.headers["internal-request-source"] = "cli";
resource.headers[sessionHeaderName] = sessionId;
resource.headers[commandNameHeaderName] = commandName;
}
const nextStream = next(resource, callback);
(resource.pipeInput(input, nextStream) as any as Readable).pipe(output);
input.resume();
});
};
}