Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
) => response => {
const clonedResponse = cloneResponse(response);
const clonedResponsePassThrough = cloneResponse(response);
try {
const { headers, statusCode } = clonedResponse;
const receivedTime = new Date().getTime();
let body = '';
clonedResponse.on('data', chunk => (body += chunk));
let responseData = {};
clonedResponse.on(
'end',
safeExecute(() => {
responseData = {
statusCode,
receivedTime,
body,
) => response => {
const clonedResponse1 = cloneResponse(response);
const clonedResponse2 = cloneResponse(response);
const { headers, statusCode } = clonedResponse1;
const receivedTime = new Date().getTime();
let body = '';
clonedResponse1.on('data', chunk => (body += chunk));
let responseData = {};
clonedResponse1.on('end', () => {
responseData = {
statusCode,
receivedTime,
body,
headers: lowerCaseObjectKeys(headers),
};
const httpSpan = getHttpSpan(requestData, responseData);
SpansHive.addSpan(httpSpan);
) => response => {
const clonedResponse = cloneResponse(response);
const clonedResponsePassThrough = cloneResponse(response);
try {
const { headers, statusCode } = clonedResponse;
const receivedTime = new Date().getTime();
let body = '';
clonedResponse.on('data', chunk => (body += chunk));
let responseData = {};
clonedResponse.on(
'end',
safeExecute(() => {
responseData = {
statusCode,
receivedTime,
body,
headers: lowerCaseObjectKeys(headers),
) => response => {
const clonedResponse1 = cloneResponse(response);
const clonedResponse2 = cloneResponse(response);
const { headers, statusCode } = clonedResponse1;
const receivedTime = new Date().getTime();
let body = '';
clonedResponse1.on('data', chunk => (body += chunk));
let responseData = {};
clonedResponse1.on('end', () => {
responseData = {
statusCode,
receivedTime,
body,
headers: lowerCaseObjectKeys(headers),
};
const httpSpan = getHttpSpan(requestData, responseData);