File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,16 @@ import { getCurrentHub } from '@sentry/core';
33import type { ReplayContainer } from '../types' ;
44
55/**
6- * Check whether a given request URL should be filtered out.
6+ * Check whether a given request URL should be filtered out. This is so we
7+ * don't log Sentry ingest requests.
78 */
89export function shouldFilterRequest ( replay : ReplayContainer , url : string ) : boolean {
910 // If we enabled the `traceInternals` experiment, we want to trace everything
1011 if ( __DEBUG_BUILD__ && replay . getOptions ( ) . _experiments . traceInternals ) {
1112 return false ;
1213 }
1314
14- return ! _isSentryRequest ( url ) ;
15+ return _isSentryRequest ( url ) ;
1516}
1617
1718/**
Original file line number Diff line number Diff line change 1+ import { shouldFilterRequest } from '../../src/util/shouldFilterRequest' ;
2+ import { mockSdk } from '../index' ;
3+
4+ describe ( 'Integration | shouldFilterRequest' , ( ) => {
5+ beforeEach ( ( ) => {
6+ jest . resetModules ( ) ;
7+ } ) ;
8+
9+ it ( 'should not filter requests from non-Sentry ingest URLs' , async ( ) => {
10+ const { replay } = await mockSdk ( ) ;
11+
12+ expect ( shouldFilterRequest ( replay , 'https://example.com/foo' ) ) . toBe ( false ) ;
13+ } ) ;
14+
15+ it ( 'should filter requests for Sentry ingest URLs' , async ( ) => {
16+ const { replay } = await mockSdk ( ) ;
17+
18+ expect ( shouldFilterRequest ( replay , 'https://03031aa.ingest.f00.f00/api/129312/' ) ) . toBe ( true ) ;
19+ } ) ;
20+ } ) ;
You can’t perform that action at this time.
0 commit comments