Skip to content

Commit 03cb275

Browse files
Change naming for networkDetailExcludeUrls to networkDetailDenyUrls
1 parent 278d442 commit 03cb275

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

packages/replay/src/coreHandlers/handleNetworkBreadcrumbs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function handleNetworkBreadcrumbs(replay: ReplayContainer): void {
3333

3434
const {
3535
networkDetailAllowUrls,
36-
networkDetailExcludeUrls,
36+
networkDetailDenyUrls,
3737
networkCaptureBodies,
3838
networkRequestHeaders,
3939
networkResponseHeaders,
@@ -43,7 +43,7 @@ export function handleNetworkBreadcrumbs(replay: ReplayContainer): void {
4343
replay,
4444
textEncoder,
4545
networkDetailAllowUrls,
46-
networkDetailExcludeUrls,
46+
networkDetailDenyUrls,
4747
networkCaptureBodies,
4848
networkRequestHeaders,
4949
networkResponseHeaders,

packages/replay/src/coreHandlers/util/fetchUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async function _prepareFetchData(
8686
} = breadcrumb.data;
8787

8888
const captureDetails =
89-
urlMatches(url, options.networkDetailAllowUrls) && !urlMatches(url, options.networkDetailExcludeUrls);
89+
urlMatches(url, options.networkDetailAllowUrls) && !urlMatches(url, options.networkDetailDenyUrls);
9090

9191
const request = captureDetails
9292
? _getRequestInfo(options, hint.input, requestBodySize)

packages/replay/src/coreHandlers/util/xhrUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function _prepareXhrData(
7878
return null;
7979
}
8080

81-
if (!urlMatches(url, options.networkDetailAllowUrls) || urlMatches(url, options.networkDetailExcludeUrls)) {
81+
if (!urlMatches(url, options.networkDetailAllowUrls) || urlMatches(url, options.networkDetailDenyUrls)) {
8282
const request = buildSkippedNetworkRequestOrResponse(requestBodySize);
8383
const response = buildSkippedNetworkRequestOrResponse(responseBodySize);
8484
return {

packages/replay/src/integration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class Replay implements Integration {
6767
slowClickIgnoreSelectors = [],
6868

6969
networkDetailAllowUrls = [],
70-
networkDetailExcludeUrls = [],
70+
networkDetailDenyUrls = [],
7171
networkCaptureBodies = true,
7272
networkRequestHeaders = [],
7373
networkResponseHeaders = [],
@@ -139,7 +139,7 @@ export class Replay implements Integration {
139139
slowClickTimeout,
140140
slowClickIgnoreSelectors,
141141
networkDetailAllowUrls,
142-
networkDetailExcludeUrls,
142+
networkDetailDenyUrls,
143143
networkCaptureBodies,
144144
networkRequestHeaders: _getMergedNetworkHeaders(networkRequestHeaders),
145145
networkResponseHeaders: _getMergedNetworkHeaders(networkResponseHeaders),

packages/replay/src/types/replay.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,31 +71,31 @@ export interface ReplayNetworkOptions {
7171
networkDetailAllowUrls: (string | RegExp)[];
7272

7373
/**
74-
* Exclude request/response details for XHR/Fetch requests that match the given URLs.
74+
* Deny request/response details for XHR/Fetch requests that match the given URLs.
7575
* The URLs can be strings or regular expressions.
76-
* When provided a string, we will exclude any URL that contains the given string.
76+
* When provided a string, we will deny any URL that contains the given string.
7777
* You can use a Regex to handle exact matches or more complex matching.
7878
* URLs matching these patterns will not have bodies & additional headers captured.
7979
*/
80-
networkDetailExcludeUrls: (string | RegExp)[];
80+
networkDetailDenyUrls: (string | RegExp)[];
8181

8282
/**
8383
* If request & response bodies should be captured.
84-
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailExcludeUrls`.
84+
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
8585
* Defaults to true.
8686
*/
8787
networkCaptureBodies: boolean;
8888

8989
/**
9090
* Capture the following request headers, in addition to the default ones.
91-
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailExcludeUrls`.
91+
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
9292
* Any headers defined here will be captured in addition to the default headers.
9393
*/
9494
networkRequestHeaders: string[];
9595

9696
/**
9797
* Capture the following response headers, in addition to the default ones.
98-
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailExcludeUrls`.
98+
* Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
9999
* Any headers defined here will be captured in addition to the default headers.
100100
*/
101101
networkResponseHeaders: string[];

packages/replay/test/unit/coreHandlers/handleNetworkBreadcrumbs.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('Unit | coreHandlers | handleNetworkBreadcrumbs', () => {
6363
textEncoder: new TextEncoder(),
6464
replay: setupReplayContainer(),
6565
networkDetailAllowUrls: ['https://example.com'],
66-
networkDetailExcludeUrls: ['http://localhost:8080'],
66+
networkDetailDenyUrls: ['http://localhost:8080'],
6767
networkCaptureBodies: false,
6868
networkRequestHeaders: ['content-type', 'accept', 'x-custom-header'],
6969
networkResponseHeaders: ['content-type', 'accept', 'x-custom-header'],
@@ -1390,8 +1390,8 @@ other-header: test`;
13901390
['exact regex match', 'http://example.com/exact'],
13911391
['partial regex match', 'http://example.com/partial/string'],
13921392
])('matching URL %s', (_label, url) => {
1393-
it('correctly excludes URL for fetch request', async () => {
1394-
options.networkDetailExcludeUrls = [
1393+
it('correctly deny URL for fetch request', async () => {
1394+
options.networkDetailDenyUrls = [
13951395
'https://example.com/foo',
13961396
'com/bar',
13971397
/^http:\/\/example.com\/exact$/,
@@ -1465,8 +1465,8 @@ other-header: test`;
14651465
]);
14661466
});
14671467

1468-
it('correctly excludes URL for xhr request', async () => {
1469-
options.networkDetailExcludeUrls = [
1468+
it('correctly deny URL for xhr request', async () => {
1469+
options.networkDetailDenyUrls = [
14701470
'https://example.com/foo',
14711471
'com/bar',
14721472
/^http:\/\/example.com\/exact$/,

packages/replay/test/utils/setupReplayContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const DEFAULT_OPTIONS = {
1212
useCompression: false,
1313
blockAllMedia: true,
1414
networkDetailAllowUrls: [],
15-
networkDetailExcludeUrls: [],
15+
networkDetailDenyUrls: [],
1616
networkCaptureBodies: true,
1717
networkRequestHeaders: [],
1818
networkResponseHeaders: [],

0 commit comments

Comments
 (0)