Skip to content

Commit

Permalink
Use object.entries instead of object.values
Browse files Browse the repository at this point in the history
  • Loading branch information
AHarmlessPyro committed Oct 14, 2022
1 parent ab51d14 commit 538dd56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ingestors/node/src/modules/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
6 changes: 3 additions & 3 deletions ingestors/node/src/modules/koa.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 538dd56

Please sign in to comment.