From 4a7928510d19d5fe2116e3e48a24315dda423a77 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Fri, 20 Dec 2024 09:39:03 +0000 Subject: [PATCH 1/2] fix: payload host deny list --- src/extensions/replay/config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/extensions/replay/config.ts b/src/extensions/replay/config.ts index 1ec0537c6..eda15757d 100644 --- a/src/extensions/replay/config.ts +++ b/src/extensions/replay/config.ts @@ -48,7 +48,13 @@ export const defaultNetworkOptions: Required = { 'resource', ], payloadSizeLimitBytes: 1000000, - payloadHostDenyList: ['.lr-ingest.io', '.ingest.sentry.io'], + payloadHostDenyList: [ + '.lr-ingest.io', + '.ingest.sentry.io', + '.clarity.ms', + // NB no leading dot here + 'analytics.google.com', + ], } const HEADER_DENY_LIST = [ From aa147e96b9410b07817957c9c1cf105fd9c3d14c Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Fri, 20 Dec 2024 09:54:09 +0000 Subject: [PATCH 2/2] tdd for realz --- src/__tests__/extensions/replay/config.test.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/__tests__/extensions/replay/config.test.ts b/src/__tests__/extensions/replay/config.test.ts index 20b2faec3..b6bc35115 100644 --- a/src/__tests__/extensions/replay/config.test.ts +++ b/src/__tests__/extensions/replay/config.test.ts @@ -210,13 +210,26 @@ describe('config', () => { describe('payloadHostDenyList', () => { it('uses a default when none provided', () => { const networkOptions = buildNetworkRequestOptions(defaultConfig(), {}) - expect(networkOptions.payloadHostDenyList).toEqual(['.lr-ingest.io', '.ingest.sentry.io']) + expect(networkOptions.payloadHostDenyList).toEqual([ + '.lr-ingest.io', + '.ingest.sentry.io', + '.clarity.ms', + 'analytics.google.com', + ]) }) + it('adds to the default when deny list is provided', () => { const networkOptions = buildNetworkRequestOptions(defaultConfig(), { payloadHostDenyList: ['wat', 'huh'], }) - expect(networkOptions.payloadHostDenyList).toEqual(['wat', 'huh', '.lr-ingest.io', '.ingest.sentry.io']) + expect(networkOptions.payloadHostDenyList).toEqual([ + 'wat', + 'huh', + '.lr-ingest.io', + '.ingest.sentry.io', + '.clarity.ms', + 'analytics.google.com', + ]) }) }) })