From 7957e96337100cbe43e988bd5f77ef3c43fb6588 Mon Sep 17 00:00:00 2001 From: Aidan Walters-Williams Date: Wed, 3 Jun 2020 21:30:08 +0100 Subject: [PATCH 1/4] Remove use of the words blacklist and whitelist --- MIGRATION.md | 4 +- packages/browser/examples/app.js | 8 +- packages/browser/examples/index.html | 4 +- packages/browser/src/backend.ts | 8 +- .../browser/test/integration/common/init.js | 6 +- .../browser/test/integration/suites/config.js | 16 +-- .../core/src/integrations/inboundfilters.ts | 28 ++-- .../lib/integrations/inboundfilters.test.ts | 126 +++++++++--------- packages/utils/src/misc.ts | 6 +- 9 files changed, 104 insertions(+), 102 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 06a40b167305..15ba972aea14 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -255,6 +255,8 @@ Sentry.addBreadcrumb({ > 'ignoreUrls' was renamed to 'blacklistUrls'. 'ignoreErrors', which has a similar name was not renamed. [Docs](https://docs.sentry.io/error-reporting/configuration/?platform=browser#blacklist-urls) and [Decluttering Sentry](https://docs.sentry.io/platforms/javascript/#decluttering-sentry) +> 'blacklistUrls' has since been renamed to 'excludedUrls' + _Old_: ```js @@ -270,7 +272,7 @@ _New_: ```js Sentry.init({ - blacklistUrls: [ + excludedUrls: [ 'https://www.baddomain.com', /graph\.facebook\.com/i, ], diff --git a/packages/browser/examples/app.js b/packages/browser/examples/app.js index a6035444c43a..21630e6d98bd 100644 --- a/packages/browser/examples/app.js +++ b/packages/browser/examples/app.js @@ -37,9 +37,9 @@ Sentry.init({ // An array of strings or regexps that'll be used to ignore specific errors based on their type/message ignoreErrors: [/PickleRick_\d\d/, 'RangeError'], // An array of strings or regexps that'll be used to ignore specific errors based on their origin url - blacklistUrls: ['external-lib.js'], + excludedUrls: ['external-lib.js'], // An array of strings or regexps that'll be used to allow specific errors based on their origin url - whitelistUrls: ['http://localhost:5000', 'https://browser.sentry-cdn'], + includedUrls: ['http://localhost:5000', 'https://browser.sentry-cdn'], // Debug mode with valuable initialization/lifecycle informations. debug: true, // Whether SDK should be enabled or not. @@ -93,7 +93,7 @@ Sentry.init({ // Testing code, irrelevant vvvvv document.addEventListener('DOMContentLoaded', () => { - document.querySelector('#blacklist-url').addEventListener('click', () => { + document.querySelector('#excluded-url').addEventListener('click', () => { const script = document.createElement('script'); script.crossOrigin = 'anonymous'; script.src = @@ -101,7 +101,7 @@ document.addEventListener('DOMContentLoaded', () => { document.body.appendChild(script); }); - document.querySelector('#whitelist-url').addEventListener('click', () => { + document.querySelector('#included-url').addEventListener('click', () => { const script = document.createElement('script'); script.crossOrigin = 'anonymous'; script.src = diff --git a/packages/browser/examples/index.html b/packages/browser/examples/index.html index a6f3915b2d84..d49b7e210ed7 100644 --- a/packages/browser/examples/index.html +++ b/packages/browser/examples/index.html @@ -20,8 +20,8 @@ - - + + diff --git a/packages/browser/src/backend.ts b/packages/browser/src/backend.ts index a7c5847fa1a8..28b49ad83c0f 100644 --- a/packages/browser/src/backend.ts +++ b/packages/browser/src/backend.ts @@ -12,17 +12,17 @@ import { FetchTransport, XHRTransport } from './transports'; export interface BrowserOptions extends Options { /** * A pattern for error URLs which should not be sent to Sentry. - * To whitelist certain errors instead, use {@link Options.whitelistUrls}. + * To include certain errors instead, use {@link Options.includedUrls}. * By default, all errors will be sent. */ - blacklistUrls?: Array; + excludedUrls?: Array; /** * A pattern for error URLs which should exclusively be sent to Sentry. - * This is the opposite of {@link Options.blacklistUrls}. + * This is the opposite of {@link Options.excludedUrls}. * By default, all errors will be sent. */ - whitelistUrls?: Array; + includedUrls?: Array; } /** diff --git a/packages/browser/test/integration/common/init.js b/packages/browser/test/integration/common/init.js index e5f67a3ca812..95be4996fff4 100644 --- a/packages/browser/test/integration/common/init.js +++ b/packages/browser/test/integration/common/init.js @@ -34,13 +34,13 @@ function initSDK() { integrations: [new Sentry.Integrations.Dedupe()], attachStacktrace: true, ignoreErrors: ["ignoreErrorTest"], - blacklistUrls: ["foo.js"], - beforeSend: function(event, eventHint) { + excludedUrls: ["foo.js"], + beforeSend: function (event, eventHint) { events.push(event); eventHints.push(eventHint); return event; }, - beforeBreadcrumb: function(breadcrumb, breadcrumbHint) { + beforeBreadcrumb: function (breadcrumb, breadcrumbHint) { // Filter console logs as we use them for debugging *a lot* and they are not *that* important // But allow then if we explicitly say so (for one of integration tests) if ( diff --git a/packages/browser/test/integration/suites/config.js b/packages/browser/test/integration/suites/config.js index 3ba82a06c3fc..984da16003f7 100644 --- a/packages/browser/test/integration/suites/config.js +++ b/packages/browser/test/integration/suites/config.js @@ -21,10 +21,10 @@ describe("config", function() { * > bar.js file called a function in baz.js * > baz.js threw an error * - * foo.js is blacklisted in the `init` call (init.js), thus we filter it + * foo.js is excluded in the `init` call (init.js), thus we filter it * */ - var urlWithBlacklistedUrl = new Error("filter"); - urlWithBlacklistedUrl.stack = + var urlWithExcludedUrl = new Error("filter"); + urlWithExcludedUrl.stack = "Error: bar\n" + " at http://localhost:5000/foo.js:7:19\n" + " at bar(http://localhost:5000/bar.js:2:3)\n" + @@ -35,17 +35,17 @@ describe("config", function() { * > bar-pass.js file called a function in baz-pass.js * > baz-pass.js threw an error * - * foo-pass.js is *not* blacklisted in the `init` call (init.js), thus we don't filter it + * foo-pass.js is *not* excluded in the `init` call (init.js), thus we don't filter it * */ - var urlWithoutBlacklistedUrl = new Error("pass"); - urlWithoutBlacklistedUrl.stack = + var urlWithoutExcludedUrl = new Error("pass"); + urlWithoutExcludedUrl.stack = "Error: bar\n" + " at http://localhost:5000/foo-pass.js:7:19\n" + " at bar(http://localhost:5000/bar-pass.js:2:3)\n" + " at baz(http://localhost:5000/baz-pass.js:2:9)\n"; - Sentry.captureException(urlWithBlacklistedUrl); - Sentry.captureException(urlWithoutBlacklistedUrl); + Sentry.captureException(urlWithExcludedUrl); + Sentry.captureException(urlWithoutExcludedUrl); }).then(function(summary) { assert.lengthOf(summary.events, 1); assert.equal(summary.events[0].exception.values[0].type, "Error"); diff --git a/packages/core/src/integrations/inboundfilters.ts b/packages/core/src/integrations/inboundfilters.ts index 99ece511eac5..093a4ede220a 100644 --- a/packages/core/src/integrations/inboundfilters.ts +++ b/packages/core/src/integrations/inboundfilters.ts @@ -8,10 +8,10 @@ const DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script e /** JSDoc */ interface InboundFiltersOptions { - blacklistUrls?: Array; + excludedUrls?: Array; ignoreErrors?: Array; ignoreInternal?: boolean; - whitelistUrls?: Array; + includedUrls?: Array; } /** Inbound filters configurable by the user */ @@ -61,17 +61,17 @@ export class InboundFilters implements Integration { ); return true; } - if (this._isBlacklistedUrl(event, options)) { + if (this._isExcludedUrl(event, options)) { logger.warn( - `Event dropped due to being matched by \`blacklistUrls\` option.\nEvent: ${getEventDescription( + `Event dropped due to being matched by \`excludedUrls\` option.\nEvent: ${getEventDescription( event, )}.\nUrl: ${this._getEventFilterUrl(event)}`, ); return true; } - if (!this._isWhitelistedUrl(event, options)) { + if (!this._isIncludedUrl(event, options)) { logger.warn( - `Event dropped due to not being matched by \`whitelistUrls\` option.\nEvent: ${getEventDescription( + `Event dropped due to not being matched by \`includedUrls\` option.\nEvent: ${getEventDescription( event, )}.\nUrl: ${this._getEventFilterUrl(event)}`, ); @@ -113,36 +113,36 @@ export class InboundFilters implements Integration { } /** JSDoc */ - private _isBlacklistedUrl(event: Event, options: InboundFiltersOptions = {}): boolean { + private _isExcludedUrl(event: Event, options: InboundFiltersOptions = {}): boolean { // TODO: Use Glob instead? - if (!options.blacklistUrls || !options.blacklistUrls.length) { + if (!options.excludedUrls || !options.excludedUrls.length) { return false; } const url = this._getEventFilterUrl(event); - return !url ? false : options.blacklistUrls.some(pattern => isMatchingPattern(url, pattern)); + return !url ? false : options.excludedUrls.some(pattern => isMatchingPattern(url, pattern)); } /** JSDoc */ - private _isWhitelistedUrl(event: Event, options: InboundFiltersOptions = {}): boolean { + private _isIncludedUrl(event: Event, options: InboundFiltersOptions = {}): boolean { // TODO: Use Glob instead? - if (!options.whitelistUrls || !options.whitelistUrls.length) { + if (!options.includedUrls || !options.includedUrls.length) { return true; } const url = this._getEventFilterUrl(event); - return !url ? true : options.whitelistUrls.some(pattern => isMatchingPattern(url, pattern)); + return !url ? true : options.includedUrls.some(pattern => isMatchingPattern(url, pattern)); } /** JSDoc */ private _mergeOptions(clientOptions: InboundFiltersOptions = {}): InboundFiltersOptions { return { - blacklistUrls: [...(this._options.blacklistUrls || []), ...(clientOptions.blacklistUrls || [])], + excludedUrls: [...(this._options.excludedUrls || []), ...(clientOptions.excludedUrls || [])], ignoreErrors: [ ...(this._options.ignoreErrors || []), ...(clientOptions.ignoreErrors || []), ...DEFAULT_IGNORE_ERRORS, ], ignoreInternal: typeof this._options.ignoreInternal !== 'undefined' ? this._options.ignoreInternal : true, - whitelistUrls: [...(this._options.whitelistUrls || []), ...(clientOptions.whitelistUrls || [])], + includedUrls: [...(this._options.includedUrls || []), ...(clientOptions.includedUrls || [])], }; } diff --git a/packages/core/test/lib/integrations/inboundfilters.test.ts b/packages/core/test/lib/integrations/inboundfilters.test.ts index 14b06bc138c6..44c9d859762f 100644 --- a/packages/core/test/lib/integrations/inboundfilters.test.ts +++ b/packages/core/test/lib/integrations/inboundfilters.test.ts @@ -18,38 +18,38 @@ describe('InboundFilters', () => { expect(inboundFilters._shouldDropEvent({}, inboundFilters._mergeOptions())).toBe(true); }); - it('should drop when url is blacklisted', () => { - inboundFilters._isBlacklistedUrl = () => true; + it('should drop when url is excluded', () => { + inboundFilters._isExcludedUrl = () => true; expect(inboundFilters._shouldDropEvent({}, inboundFilters._mergeOptions())).toBe(true); }); - it('should drop when url is not whitelisted', () => { - inboundFilters._isWhitelistedUrl = () => false; + it('should drop when url is not included', () => { + inboundFilters._isIncludedUrl = () => false; expect(inboundFilters._shouldDropEvent({}, inboundFilters._mergeOptions())).toBe(true); }); - it('should drop when url is not blacklisted, but also not whitelisted', () => { - inboundFilters._isBlacklistedUrl = () => false; - inboundFilters._isWhitelistedUrl = () => false; + it('should drop when url is not excluded, but also not included', () => { + inboundFilters._isExcludedUrl = () => false; + inboundFilters._isIncludedUrl = () => false; expect(inboundFilters._shouldDropEvent({}, inboundFilters._mergeOptions())).toBe(true); }); - it('should drop when url is blacklisted and whitelisted at the same time', () => { - inboundFilters._isBlacklistedUrl = () => true; - inboundFilters._isWhitelistedUrl = () => true; + it('should drop when url is excluded and included at the same time', () => { + inboundFilters._isExcludedUrl = () => true; + inboundFilters._isIncludedUrl = () => true; expect(inboundFilters._shouldDropEvent({}, inboundFilters._mergeOptions())).toBe(true); }); - it('should not drop when url is not blacklisted, but whitelisted', () => { - inboundFilters._isBlacklistedUrl = () => false; - inboundFilters._isWhitelistedUrl = () => true; + it('should not drop when url is not excluded, but included', () => { + inboundFilters._isExcludedUrl = () => false; + inboundFilters._isIncludedUrl = () => true; expect(inboundFilters._shouldDropEvent({}, inboundFilters._mergeOptions())).toBe(false); }); it('should not drop when any of checks dont match', () => { inboundFilters._isIgnoredError = () => false; - inboundFilters._isBlacklistedUrl = () => false; - inboundFilters._isWhitelistedUrl = () => true; + inboundFilters._isExcludedUrl = () => false; + inboundFilters._isIncludedUrl = () => true; expect(inboundFilters._shouldDropEvent({}, inboundFilters._mergeOptions())).toBe(false); }); }); @@ -251,7 +251,7 @@ describe('InboundFilters', () => { }); }); - describe('blacklistUrls/whitelistUrls', () => { + describe('excludedUrls/includedUrls', () => { const messageEvent = { message: 'wat', stacktrace: { @@ -284,20 +284,20 @@ describe('InboundFilters', () => { it('should filter captured message based on its stack trace using string filter', () => { expect( - inboundFilters._isBlacklistedUrl( + inboundFilters._isExcludedUrl( messageEvent, inboundFilters._mergeOptions({ - blacklistUrls: ['https://awesome-analytics.io'], - whitelistUrls: ['https://awesome-analytics.io'], + excludedUrls: ['https://awesome-analytics.io'], + includedUrls: ['https://awesome-analytics.io'], }), ), ).toBe(true); expect( - inboundFilters._isWhitelistedUrl( + inboundFilters._isIncludedUrl( messageEvent, inboundFilters._mergeOptions({ - blacklistUrls: ['https://awesome-analytics.io'], - whitelistUrls: ['https://awesome-analytics.io'], + excludedUrls: ['https://awesome-analytics.io'], + includedUrls: ['https://awesome-analytics.io'], }), ), ).toBe(true); @@ -305,18 +305,18 @@ describe('InboundFilters', () => { it('should filter captured message based on its stack trace using regexp filter', () => { expect( - inboundFilters._isBlacklistedUrl( + inboundFilters._isExcludedUrl( messageEvent, inboundFilters._mergeOptions({ - blacklistUrls: [/awesome-analytics\.io/], + excludedUrls: [/awesome-analytics\.io/], }), ), ).toBe(true); expect( - inboundFilters._isWhitelistedUrl( + inboundFilters._isIncludedUrl( messageEvent, inboundFilters._mergeOptions({ - blacklistUrls: [/awesome-analytics\.io/], + excludedUrls: [/awesome-analytics\.io/], }), ), ).toBe(true); @@ -324,24 +324,24 @@ describe('InboundFilters', () => { it('should not filter captured messages with no stacktraces', () => { expect( - inboundFilters._isBlacklistedUrl( + inboundFilters._isExcludedUrl( { message: 'any', }, inboundFilters._mergeOptions({ - blacklistUrls: ['https://awesome-analytics.io'], - whitelistUrls: ['https://awesome-analytics.io'], + excludedUrls: ['https://awesome-analytics.io'], + includedUrls: ['https://awesome-analytics.io'], }), ), ).toBe(false); expect( - inboundFilters._isWhitelistedUrl( + inboundFilters._isIncludedUrl( { message: 'any', }, inboundFilters._mergeOptions({ - blacklistUrls: ['https://awesome-analytics.io'], - whitelistUrls: ['https://awesome-analytics.io'], + excludedUrls: ['https://awesome-analytics.io'], + includedUrls: ['https://awesome-analytics.io'], }), ), ).toBe(true); @@ -349,20 +349,20 @@ describe('InboundFilters', () => { it('should filter captured exception based on its stack trace using string filter', () => { expect( - inboundFilters._isBlacklistedUrl( + inboundFilters._isExcludedUrl( exceptionEvent, inboundFilters._mergeOptions({ - blacklistUrls: ['https://awesome-analytics.io'], - whitelistUrls: ['https://awesome-analytics.io'], + excludedUrls: ['https://awesome-analytics.io'], + includedUrls: ['https://awesome-analytics.io'], }), ), ).toBe(true); expect( - inboundFilters._isWhitelistedUrl( + inboundFilters._isIncludedUrl( exceptionEvent, inboundFilters._mergeOptions({ - blacklistUrls: ['https://awesome-analytics.io'], - whitelistUrls: ['https://awesome-analytics.io'], + excludedUrls: ['https://awesome-analytics.io'], + includedUrls: ['https://awesome-analytics.io'], }), ), ).toBe(true); @@ -370,20 +370,20 @@ describe('InboundFilters', () => { it('should filter captured exceptions based on its stack trace using regexp filter', () => { expect( - inboundFilters._isBlacklistedUrl( + inboundFilters._isExcludedUrl( exceptionEvent, inboundFilters._mergeOptions({ - blacklistUrls: [/awesome-analytics\.io/], - whitelistUrls: [/awesome-analytics\.io/], + excludedUrls: [/awesome-analytics\.io/], + includedUrls: [/awesome-analytics\.io/], }), ), ).toBe(true); expect( - inboundFilters._isWhitelistedUrl( + inboundFilters._isIncludedUrl( exceptionEvent, inboundFilters._mergeOptions({ - blacklistUrls: [/awesome-analytics\.io/], - whitelistUrls: [/awesome-analytics\.io/], + excludedUrls: [/awesome-analytics\.io/], + includedUrls: [/awesome-analytics\.io/], }), ), ).toBe(true); @@ -391,20 +391,20 @@ describe('InboundFilters', () => { it('should not filter events that doesnt pass the test', () => { expect( - inboundFilters._isBlacklistedUrl( + inboundFilters._isExcludedUrl( exceptionEvent, inboundFilters._mergeOptions({ - blacklistUrls: ['some-other-domain.com'], - whitelistUrls: ['some-other-domain.com'], + excludedUrls: ['some-other-domain.com'], + includedUrls: ['some-other-domain.com'], }), ), ).toBe(false); expect( - inboundFilters._isWhitelistedUrl( + inboundFilters._isIncludedUrl( exceptionEvent, inboundFilters._mergeOptions({ - blacklistUrls: ['some-other-domain.com'], - whitelistUrls: ['some-other-domain.com'], + excludedUrls: ['some-other-domain.com'], + includedUrls: ['some-other-domain.com'], }), ), ).toBe(false); @@ -412,46 +412,46 @@ describe('InboundFilters', () => { it('should be able to use multiple filters', () => { expect( - inboundFilters._isBlacklistedUrl( + inboundFilters._isExcludedUrl( exceptionEvent, inboundFilters._mergeOptions({ - blacklistUrls: ['some-other-domain.com', /awesome-analytics\.io/], - whitelistUrls: ['some-other-domain.com', /awesome-analytics\.io/], + excludedUrls: ['some-other-domain.com', /awesome-analytics\.io/], + includedUrls: ['some-other-domain.com', /awesome-analytics\.io/], }), ), ).toBe(true); expect( - inboundFilters._isWhitelistedUrl( + inboundFilters._isIncludedUrl( exceptionEvent, inboundFilters._mergeOptions({ - blacklistUrls: ['some-other-domain.com', /awesome-analytics\.io/], - whitelistUrls: ['some-other-domain.com', /awesome-analytics\.io/], + excludedUrls: ['some-other-domain.com', /awesome-analytics\.io/], + includedUrls: ['some-other-domain.com', /awesome-analytics\.io/], }), ), ).toBe(true); }); - it('should not fail with malformed event event and default to false for isBlacklistedUrl and true for isWhitelistedUrl', () => { + it('should not fail with malformed event event and default to false for isExcludedUrl and true for isIncludedUrl', () => { const malformedEvent = { stacktrace: { frames: undefined, }, }; expect( - inboundFilters._isBlacklistedUrl( + inboundFilters._isExcludedUrl( malformedEvent, inboundFilters._mergeOptions({ - blacklistUrls: ['https://awesome-analytics.io'], - whitelistUrls: ['https://awesome-analytics.io'], + excludedUrls: ['https://awesome-analytics.io'], + includedUrls: ['https://awesome-analytics.io'], }), ), ).toBe(false); expect( - inboundFilters._isWhitelistedUrl( + inboundFilters._isIncludedUrl( malformedEvent, inboundFilters._mergeOptions({ - blacklistUrls: ['https://awesome-analytics.io'], - whitelistUrls: ['https://awesome-analytics.io'], + excludedUrls: ['https://awesome-analytics.io'], + includedUrls: ['https://awesome-analytics.io'], }), ), ).toBe(true); diff --git a/packages/utils/src/misc.ts b/packages/utils/src/misc.ts index cc63caa8f165..0797e3a53c83 100644 --- a/packages/utils/src/misc.ts +++ b/packages/utils/src/misc.ts @@ -335,9 +335,9 @@ function _htmlElementAsString(el: unknown): string { out.push(`.${classes[i]}`); } } - const attrWhitelist = ['type', 'name', 'title', 'alt']; - for (i = 0; i < attrWhitelist.length; i++) { - key = attrWhitelist[i]; + const includedAttrs = ['type', 'name', 'title', 'alt']; + for (i = 0; i < includedAttrs.length; i++) { + key = includedAttrs[i]; attr = elem.getAttribute(key); if (attr) { out.push(`[${key}="${attr}"]`); From e3bb16cfe1c9953efe5289aa215de2af0b5164aa Mon Sep 17 00:00:00 2001 From: Aidan Walters-Williams Date: Thu, 4 Jun 2020 22:28:30 +0100 Subject: [PATCH 2/4] Add fallback for blacklistUrls and use fallback in tests to ensure functionality --- MIGRATION.md | 2 +- packages/browser/src/backend.ts | 2 ++ packages/browser/src/sdk.ts | 3 +++ packages/browser/test/integration/common/init.js | 6 +++--- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 15ba972aea14..34f089dc8a12 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -272,7 +272,7 @@ _New_: ```js Sentry.init({ - excludedUrls: [ + blacklistUrls: [ 'https://www.baddomain.com', /graph\.facebook\.com/i, ], diff --git a/packages/browser/src/backend.ts b/packages/browser/src/backend.ts index 28b49ad83c0f..ad26f56760ad 100644 --- a/packages/browser/src/backend.ts +++ b/packages/browser/src/backend.ts @@ -16,6 +16,7 @@ export interface BrowserOptions extends Options { * By default, all errors will be sent. */ excludedUrls?: Array; + blacklistedUrls?: Array; /** * A pattern for error URLs which should exclusively be sent to Sentry. @@ -23,6 +24,7 @@ export interface BrowserOptions extends Options { * By default, all errors will be sent. */ includedUrls?: Array; + whitelistedUrls?: Array; } /** diff --git a/packages/browser/src/sdk.ts b/packages/browser/src/sdk.ts index 074d308c8918..4426e42fae89 100644 --- a/packages/browser/src/sdk.ts +++ b/packages/browser/src/sdk.ts @@ -77,6 +77,9 @@ export function init(options: BrowserOptions = {}): void { if (options.defaultIntegrations === undefined) { options.defaultIntegrations = defaultIntegrations; } + // Deprecate, but still support old exclusion/inclusion types + options.excludedUrls = options.excludedUrls || options.blacklistedUrls; + options.includedUrls = options.includedUrls || options.whitelistedUrls; if (options.release === undefined) { const window = getGlobalObject(); // This supports the variable that sentry-webpack-plugin injects diff --git a/packages/browser/test/integration/common/init.js b/packages/browser/test/integration/common/init.js index 95be4996fff4..e5f67a3ca812 100644 --- a/packages/browser/test/integration/common/init.js +++ b/packages/browser/test/integration/common/init.js @@ -34,13 +34,13 @@ function initSDK() { integrations: [new Sentry.Integrations.Dedupe()], attachStacktrace: true, ignoreErrors: ["ignoreErrorTest"], - excludedUrls: ["foo.js"], - beforeSend: function (event, eventHint) { + blacklistUrls: ["foo.js"], + beforeSend: function(event, eventHint) { events.push(event); eventHints.push(eventHint); return event; }, - beforeBreadcrumb: function (breadcrumb, breadcrumbHint) { + beforeBreadcrumb: function(breadcrumb, breadcrumbHint) { // Filter console logs as we use them for debugging *a lot* and they are not *that* important // But allow then if we explicitly say so (for one of integration tests) if ( From 5099d28958316bfd46809af37c770439708975f8 Mon Sep 17 00:00:00 2001 From: Aidan Walters-Williams Date: Thu, 4 Jun 2020 22:30:40 +0100 Subject: [PATCH 3/4] Typo --- packages/browser/src/backend.ts | 4 ++-- packages/browser/src/sdk.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/browser/src/backend.ts b/packages/browser/src/backend.ts index ad26f56760ad..5497ae232086 100644 --- a/packages/browser/src/backend.ts +++ b/packages/browser/src/backend.ts @@ -16,7 +16,7 @@ export interface BrowserOptions extends Options { * By default, all errors will be sent. */ excludedUrls?: Array; - blacklistedUrls?: Array; + blacklistUrls?: Array; /** * A pattern for error URLs which should exclusively be sent to Sentry. @@ -24,7 +24,7 @@ export interface BrowserOptions extends Options { * By default, all errors will be sent. */ includedUrls?: Array; - whitelistedUrls?: Array; + whitelistfUrls?: Array; } /** diff --git a/packages/browser/src/sdk.ts b/packages/browser/src/sdk.ts index 4426e42fae89..b56ab343d05f 100644 --- a/packages/browser/src/sdk.ts +++ b/packages/browser/src/sdk.ts @@ -78,8 +78,8 @@ export function init(options: BrowserOptions = {}): void { options.defaultIntegrations = defaultIntegrations; } // Deprecate, but still support old exclusion/inclusion types - options.excludedUrls = options.excludedUrls || options.blacklistedUrls; - options.includedUrls = options.includedUrls || options.whitelistedUrls; + options.excludedUrls = options.excludedUrls || options.blacklistUrls; + options.includedUrls = options.includedUrls || options.whitelistUrls; if (options.release === undefined) { const window = getGlobalObject(); // This supports the variable that sentry-webpack-plugin injects From e7fba9ca11032af345a7988e1f2068309c370bc7 Mon Sep 17 00:00:00 2001 From: Aidan Walters-Williams Date: Thu, 4 Jun 2020 22:31:25 +0100 Subject: [PATCH 4/4] Ugh --- packages/browser/src/backend.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/browser/src/backend.ts b/packages/browser/src/backend.ts index 5497ae232086..6834d269ff54 100644 --- a/packages/browser/src/backend.ts +++ b/packages/browser/src/backend.ts @@ -24,7 +24,7 @@ export interface BrowserOptions extends Options { * By default, all errors will be sent. */ includedUrls?: Array; - whitelistfUrls?: Array; + whitelistUrls?: Array; } /**