Skip to content

Commit

Permalink
fix: payload host deny list (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Dec 20, 2024
1 parent f1cf456 commit 44f0bdb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/__tests__/extensions/replay/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
])
})
})
})
Expand Down
8 changes: 7 additions & 1 deletion src/extensions/replay/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ export const defaultNetworkOptions: Required<NetworkRecordOptions> = {
'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 = [
Expand Down

0 comments on commit 44f0bdb

Please sign in to comment.