From 538dd56275a640426343cb2f8d6f2559f43f1016 Mon Sep 17 00:00:00 2001 From: Ninad Sinha Date: Sat, 15 Oct 2022 01:57:28 +0530 Subject: [PATCH] Use object.entries instead of object.values --- ingestors/node/src/modules/express.js | 6 +++--- ingestors/node/src/modules/koa.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ingestors/node/src/modules/express.js b/ingestors/node/src/modules/express.js index cd6f02d1..131d442e 100644 --- a/ingestors/node/src/modules/express.js +++ b/ingestors/node/src/modules/express.js @@ -23,16 +23,16 @@ function initialize({ key, host, pool }) { url: { host: _req.hostname, path: _req.route.path, - parameters: _req.query, + parameters: Object.entries(_req.query).map(([k, v]) => ({ name: k, value: v })), }, - headers: _req.headers, + headers: Object.entries(_req.headers).map(([k, v]) => ({ name: k, value: v })), body: _req.body || "No Body", method: _req.method, }, response: { url: `${_req.socket.remoteAddress}:${_req.socket.remotePort}`, status: _res.statusCode, - headers: _res.getHeaders(), + headers: Object.entries(_res.getHeaders()).map(([k, v]) => ({ name: k, value: v })), body: responseBody, }, meta: { diff --git a/ingestors/node/src/modules/koa.js b/ingestors/node/src/modules/koa.js index 5139af53..78d84d42 100644 --- a/ingestors/node/src/modules/koa.js +++ b/ingestors/node/src/modules/koa.js @@ -25,16 +25,16 @@ function initialize({ key, host, pool }) { url: { host: ctx.request.hostname, path: ctx.path, - parameters: ctx.query, + parameters: Object.entries(ctx.query).map(([k, v]) => ({ name: k, value: v })), }, - headers: ctx.request.headers, + headers: Object.entries(ctx.request.headers).map(([k, v]) => ({ name: k, value: v })), body: ctx.request.body || "No Body", method: ctx.request.method, }, response: { url: `${ctx.response.socket.remoteAddress}:${ctx.response.socket.remotePort}`, status: ctx.response.statusCode, - headers: ctx.response.headers, + headers: Object.entries(ctx.response.headers).map(([k, v]) => ({ name: k, value: v })), body: ctx.body, }, meta: {