From f2bdc4c1cae1642c28eac5d7e0f07e07fe82e196 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Tue, 5 Mar 2024 14:44:32 +0000 Subject: [PATCH] just the ingestion paths --- src/__tests__/extensions/replay/config.test.ts | 9 ++++++++- src/extensions/replay/config.ts | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/__tests__/extensions/replay/config.test.ts b/src/__tests__/extensions/replay/config.test.ts index 0b9e17430..ef03f4220 100644 --- a/src/__tests__/extensions/replay/config.test.ts +++ b/src/__tests__/extensions/replay/config.test.ts @@ -150,7 +150,14 @@ describe('config', () => { ], [ { - name: 'https://app.posthog.com/i/vo/e/', + name: 'https://app.posthog.com/i/v0/e/', + }, + undefined, + ], + [ + { + // even an imaginary future world of rust session replay capture + name: 'https://app.posthog.com/i/v0/s/', }, undefined, ], diff --git a/src/extensions/replay/config.ts b/src/extensions/replay/config.ts index cbc3600fb..185346cb4 100644 --- a/src/extensions/replay/config.ts +++ b/src/extensions/replay/config.ts @@ -68,12 +68,12 @@ const removeAuthorizationHeader = (data: CapturedNetworkRequest): CapturedNetwor return data } -const POSTHOG_PATHS_TO_IGNORE = ['/s/', '/e/', '/i/v0/e/', '/i/vo/e/', '/decide/', '/static/recorder-v2.js'] +const POSTHOG_PATHS_TO_IGNORE = ['/s/', '/e/', '/i/'] // want to ignore posthog paths when capturing requests, or we can get trapped in a loop // because calls to PostHog would be reported using a call to PostHog which would be reported.... const ignorePostHogPaths = (data: CapturedNetworkRequest): CapturedNetworkRequest | undefined => { const url = convertToURL(data.name) - if (url && url.pathname && POSTHOG_PATHS_TO_IGNORE.includes(url.pathname)) { + if (url && url.pathname && POSTHOG_PATHS_TO_IGNORE.some((path) => url.pathname.startsWith(path))) { return undefined } return data