From 970fa050228d85a6de1e182ed4e573976765bfd3 Mon Sep 17 00:00:00 2001 From: JeremiahUy Date: Mon, 14 Aug 2023 14:59:39 +0200 Subject: [PATCH] ADD: extra cleaning step for url clean up and change debug response object --- src/filters/clean-event-urls.js | 2 +- src/routes/collect-auto.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filters/clean-event-urls.js b/src/filters/clean-event-urls.js index fbe049e..3d965bf 100644 --- a/src/filters/clean-event-urls.js +++ b/src/filters/clean-event-urls.js @@ -2,7 +2,7 @@ const cleanObjectUrls = require('../utils/clean-object-urls'); const cleanEventUrls = (inputEvents) => { const outputEvents = []; inputEvents.forEach(event => { - const cloneEvent = {...event}; + const cloneEvent = cleanEventUrls({...event}); cloneEvent.event_properties = cleanObjectUrls(event.event_properties || {}); cloneEvent.user_properties = cleanObjectUrls(event.user_properties || {}); outputEvents.push(cloneEvent); diff --git a/src/routes/collect-auto.js b/src/routes/collect-auto.js index 66191b2..6c1ee77 100644 --- a/src/routes/collect-auto.js +++ b/src/routes/collect-auto.js @@ -94,7 +94,7 @@ const customHandler = function (request, reply, ingresses) { reply.send(response.data); } else if (request.query.debug) { collectCounter.labels('success_with_debug', appName, teamName).inc(); - reply.send(response.data); + reply.send(response); } else { collectCounter.labels('success', appName, teamName).inc(); if(request.body.events && request.body.events !== null) {