From 2909a19e0dd32737f700a8282db1a55e19ecc20a Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 8 May 2018 21:17:16 -0500 Subject: [PATCH 1/5] GDPR: Added includePrivateInformation flags. --- src/configuration/Configuration.ts | 143 ++++++++++++++++++- src/configuration/IConfigurationSettings.ts | 1 + src/exceptionless.ts | 15 +- src/services/DefaultRequestInfoCollector.ts | 17 ++- src/services/NodeEnvironmentInfoCollector.ts | 11 +- src/services/NodeRequestInfoCollector.ts | 25 +++- 6 files changed, 195 insertions(+), 17 deletions(-) diff --git a/src/configuration/Configuration.ts b/src/configuration/Configuration.ts index ce4855dc..d10aef34 100644 --- a/src/configuration/Configuration.ts +++ b/src/configuration/Configuration.ts @@ -115,6 +115,14 @@ export class Configuration implements IConfigurationSettings { */ private _dataExclusions: string[] = []; + private _includePrivateInformation: boolean; + private _includeUserName: boolean; + private _includeMachineName: boolean; + private _includeIpAddress: boolean; + private _includeCookies: boolean; + private _includePostData: boolean; + private _includeQueryString: boolean; + /** * A list of user agent patterns. * @type {Array} @@ -148,6 +156,7 @@ export class Configuration implements IConfigurationSettings { this.serverUrl = configSettings.serverUrl; this.heartbeatServerUrl = configSettings.heartbeatServerUrl; this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval; + this.includePrivateInformation = configSettings.includePrivateInformation; this.environmentInfoCollector = inject(configSettings.environmentInfoCollector); this.errorParser = inject(configSettings.errorParser); @@ -286,6 +295,138 @@ export class Configuration implements IConfigurationSettings { this._dataExclusions = Utils.addRange(this._dataExclusions, ...exclusions); } + /** + * Gets a value indicating whether to include private information about the local machine. + * @returns {boolean} + */ + public get includePrivateInformation(): boolean { + return this._includePrivateInformation; + } + + /** + * Sets a value indicating whether to include private information about the local machine + * @param value + */ + public set includePrivateInformation(value: boolean) { + const val = value || false; + this._includePrivateInformation = val; + this.includeUserName = val; + this._includeMachineName = val; + this.includeIpAddress = val; + this.includeCookies = val; + this.includePostData = val; + this.includeQueryString = val; + this.changed(); + } + + /** + * Gets a value indicating whether to include User Name. + * @returns {boolean} + */ + public get includeUserName(): boolean { + return this._includeUserName; + } + + /** + * Sets a value indicating whether to include User Name. + * @param value + */ + public set includeUserName(value: boolean) { + this._includeUserName = value || false; + this.changed(); + } + + /** + * Gets a value indicating whether to include MachineName in MachineInfo. + * @returns {boolean} + */ + public get includeMachineName(): boolean { + return this._includeMachineName; + } + + /** + * Sets a value indicating whether to include MachineName in MachineInfo. + * @param value + */ + public set includeMachineName(value: boolean) { + this._includeMachineName = value || false; + this.changed(); + } + + /** + * Gets a value indicating whether to include Ip Addresses in MachineInfo and RequestInfo. + * @returns {boolean} + */ + public get includeIpAddress(): boolean { + return this._includeIpAddress; + } + + /** + * Sets a value indicating whether to include Ip Addresses in MachineInfo and RequestInfo. + * @param value + */ + public set includeIpAddress(value: boolean) { + this._includeIpAddress = value || false; + this.changed(); + } + + /** + * Gets a value indicating whether to include Cookies. + * NOTE: DataExclusions are applied to all Cookie keys when enabled. + * @returns {boolean} + */ + public get includeCookies(): boolean { + return this._includeCookies; + } + + /** + * Sets a value indicating whether to include Cookies. + * NOTE: DataExclusions are applied to all Cookie keys when enabled. + * @param value + */ + public set includeCookies(value: boolean) { + this._includeCookies = value || false; + this.changed(); + } + + /** + * Gets a value indicating whether to include Form/POST Data. + * NOTE: DataExclusions are only applied to Form data keys when enabled. + * @returns {boolean} + */ + public get includePostData(): boolean { + return this._includePostData; + } + + /** + * Sets a value indicating whether to include Form/POST Data. + * NOTE: DataExclusions are only applied to Form data keys when enabled. + * @param value + */ + public set includePostData(value: boolean) { + this._includePostData = value || false; + this.changed(); + } + + /** + * Gets a value indicating whether to include query string information. + * NOTE: DataExclusions are applied to all Query String keys when enabled. + * @returns {boolean} + */ + public get includeQueryString(): boolean { + return this._includeQueryString; + } + + /** + * Sets a value indicating whether to include query string information. + * NOTE: DataExclusions are applied to all Query String keys when enabled. + * @param value + */ + public set includeQueryString(value: boolean) { + this._includeQueryString = value || false; + this.changed(); + } + /** * A list of user agent patterns that will cause any event with a matching user agent to not be submitted. * @@ -468,7 +609,7 @@ export class Configuration implements IConfigurationSettings { */ public static get defaults() { if (Configuration._defaultSettings === null) { - Configuration._defaultSettings = {}; + Configuration._defaultSettings = { includePrivateInformation: true }; } return Configuration._defaultSettings; diff --git a/src/configuration/IConfigurationSettings.ts b/src/configuration/IConfigurationSettings.ts index bb57cdbc..dd5fed8e 100644 --- a/src/configuration/IConfigurationSettings.ts +++ b/src/configuration/IConfigurationSettings.ts @@ -14,6 +14,7 @@ export interface IConfigurationSettings { serverUrl?: string; heartbeatServerUrl?: string; updateSettingsWhenIdleInterval?: number; + includePrivateInformation?: boolean; environmentInfoCollector?: IEnvironmentInfoCollector; errorParser?: IErrorParser; lastReferenceIdManager?: ILastReferenceIdManager; diff --git a/src/exceptionless.ts b/src/exceptionless.ts index f40c63d8..6d989f12 100644 --- a/src/exceptionless.ts +++ b/src/exceptionless.ts @@ -64,9 +64,18 @@ import { Utils } from './Utils'; const defaults = Configuration.defaults; const settings = getDefaultsSettingsFromScriptTag(); - if (settings && (settings.apiKey || settings.serverUrl)) { - defaults.apiKey = settings.apiKey; - defaults.serverUrl = settings.serverUrl; + if (settings) { + if (settings.apiKey) { + defaults.apiKey = settings.apiKey; + } + + if (settings.serverUrl) { + defaults.serverUrl = settings.serverUrl; + } + + if (settings.includePrivateInformation) { + defaults.includePrivateInformation = settings.includePrivateInformation; + } } defaults.errorParser = new DefaultErrorParser(); diff --git a/src/services/DefaultRequestInfoCollector.ts b/src/services/DefaultRequestInfoCollector.ts index afa45ad8..e0c647e9 100644 --- a/src/services/DefaultRequestInfoCollector.ts +++ b/src/services/DefaultRequestInfoCollector.ts @@ -9,18 +9,25 @@ export class DefaultRequestInfoCollector implements IRequestInfoCollector { return null; } - const exclusions = context.client.config.dataExclusions; + const config = context.client.config; + const exclusions = config.dataExclusions; const requestInfo: IRequestInfo = { user_agent: navigator.userAgent, is_secure: location.protocol === 'https:', host: location.hostname, port: location.port && location.port !== '' ? parseInt(location.port, 10) : 80, - path: location.pathname, - // client_ip_address: 'TODO', - cookies: Utils.getCookies(document.cookie, exclusions), - query_string: Utils.parseQueryString(location.search.substring(1), exclusions) + path: location.pathname + // client_ip_address: 'TODO' }; + if (config.includeCookies) { + requestInfo.cookies = Utils.getCookies(document.cookie, exclusions); + } + + if (config.includeQueryString) { + requestInfo.query_string = Utils.parseQueryString(location.search.substring(1), exclusions); + } + if (document.referrer && document.referrer !== '') { requestInfo.referrer = document.referrer; } diff --git a/src/services/NodeEnvironmentInfoCollector.ts b/src/services/NodeEnvironmentInfoCollector.ts index a49880c3..b17b1921 100644 --- a/src/services/NodeEnvironmentInfoCollector.ts +++ b/src/services/NodeEnvironmentInfoCollector.ts @@ -36,8 +36,6 @@ export class NodeEnvironmentInfoCollector implements IEnvironmentInfoCollector { architecture: os.arch(), o_s_name: os.type(), o_s_version: os.release(), - ip_address: getIpAddresses(), - machine_name: os.hostname(), // install_id: '', runtime_version: process.version, data: { @@ -48,6 +46,15 @@ export class NodeEnvironmentInfoCollector implements IEnvironmentInfoCollector { } }; + const config = context.client.config; + if (config.includeMachineName) { + environmentInfo.machine_name = os.hostname(); + } + + if (config.includeIpAddress) { + environmentInfo.ip_address = getIpAddresses(); + } + if ((os as any).endianness) { environmentInfo.data.endianness = (os as any).endianness(); } diff --git a/src/services/NodeRequestInfoCollector.ts b/src/services/NodeRequestInfoCollector.ts index f23f7152..bc220bfb 100644 --- a/src/services/NodeRequestInfoCollector.ts +++ b/src/services/NodeRequestInfoCollector.ts @@ -10,20 +10,17 @@ export class NodeRequestInfoCollector implements IRequestInfoCollector { return null; } - const exclusions = context.client.config.dataExclusions; + const config = context.client.config; + const exclusions = config.dataExclusions; // TODO: include referrer const request = context.contextData[REQUEST_KEY]; const requestInfo: IRequestInfo = { - client_ip_address: request.ip, user_agent: request.headers['user-agent'], is_secure: request.secure, http_method: request.method, host: request.hostname || request.host, - path: request.path, - post_data: JSON.parse(Utils.stringify(request.body || {}, exclusions)), - cookies: Utils.getCookies(request.headers.cookie, exclusions), - query_string: JSON.parse(Utils.stringify(request.params || {}, exclusions)) + path: request.path }; const host = request.headers.host; @@ -32,6 +29,22 @@ export class NodeRequestInfoCollector implements IRequestInfoCollector { requestInfo.port = port; } + if (config.includeIpAddress) { + requestInfo.client_ip_address = request.ip; + } + + if (config.includeCookies) { + requestInfo.cookies = Utils.getCookies(request.headers.cookie, exclusions); + } + + if (config.includeQueryString) { + requestInfo.query_string = JSON.parse(Utils.stringify(request.params || {}, exclusions)); + } + + if (config.includePostData) { + requestInfo.post_data = JSON.parse(Utils.stringify(request.body || {}, exclusions)); + } + return requestInfo; } } From 4d82b3f1861f128eea640747b8281a8fce442d39 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 8 May 2018 21:17:40 -0500 Subject: [PATCH 2/5] Fixed a bug where config values may not always be overridden & Config tests --- src/Utils.ts | 4 ++-- src/configuration/Configuration-spec.ts | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Utils.ts b/src/Utils.ts index 33c88e9c..da28dda7 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -59,13 +59,13 @@ export class Utils { const result: object = {}; for (const key in defaultValues || {}) { - if (!!defaultValues[key]) { + if (defaultValues[key] !== undefined && defaultValues[key] !== null) { result[key] = defaultValues[key]; } } for (const key in values || {}) { - if (!!values[key]) { + if (values[key] !== undefined && values[key] !== null) { result[key] = values[key]; } } diff --git a/src/configuration/Configuration-spec.ts b/src/configuration/Configuration-spec.ts index 39aac1ec..b49394e2 100644 --- a/src/configuration/Configuration-spec.ts +++ b/src/configuration/Configuration-spec.ts @@ -19,6 +19,31 @@ describe('Configuration', () => { config = new Configuration({ apiKey: null }); expect(config.apiKey).to.equal('test'); + expect(config.includePrivateInformation).to.true; + expect(config.includeUserName).to.true; + expect(config.includeMachineName).to.true; + expect(config.includeIpAddress).to.true; + expect(config.includeCookies).to.true; + expect(config.includePostData).to.true; + expect(config.includeQueryString).to.true; + + config = new Configuration({ includePrivateInformation: false }); + expect(config.includePrivateInformation).to.false; + expect(config.includeUserName).to.false; + expect(config.includeMachineName).to.false; + expect(config.includeIpAddress).to.false; + expect(config.includeCookies).to.false; + expect(config.includePostData).to.false; + expect(config.includeQueryString).to.false; + + config.includeMachineName = true; + expect(config.includePrivateInformation).to.false; + expect(config.includeUserName).to.false; + expect(config.includeMachineName).to.true; + expect(config.includeIpAddress).to.false; + expect(config.includeCookies).to.false; + expect(config.includePostData).to.false; + expect(config.includeQueryString).to.false; }); it('should not add duplicate plugin', () => { From 33f64d9e52353750aae3fa9e9536bd000b43a537 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 8 May 2018 21:29:47 -0500 Subject: [PATCH 3/5] Added ability to get configuration from config end point --- src/configuration/Configuration.ts | 29 +++++++++++++++++++++ src/configuration/IConfigurationSettings.ts | 1 + src/submission/DefaultSubmissionClient.ts | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/configuration/Configuration.ts b/src/configuration/Configuration.ts index d10aef34..c69ffeb9 100644 --- a/src/configuration/Configuration.ts +++ b/src/configuration/Configuration.ts @@ -94,6 +94,13 @@ export class Configuration implements IConfigurationSettings { */ private _serverUrl: string = 'https://collector.exceptionless.io'; + /** + * The config server url that all configuration will be retrieved from. + * @type {string} + * @private + */ + private _configServerUrl: string = 'https://config.exceptionless.io'; + /** * The heartbeat server url that all heartbeats will be sent to. * @type {string} @@ -154,6 +161,7 @@ export class Configuration implements IConfigurationSettings { this.log = inject(configSettings.log) || new NullLog(); this.apiKey = configSettings.apiKey; this.serverUrl = configSettings.serverUrl; + this.configServerUrl = configSettings.configServerUrl; this.heartbeatServerUrl = configSettings.heartbeatServerUrl; this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval; this.includePrivateInformation = configSettings.includePrivateInformation; @@ -214,12 +222,33 @@ export class Configuration implements IConfigurationSettings { public set serverUrl(value: string) { if (!!value) { this._serverUrl = value; + this._configServerUrl = value; this._heartbeatServerUrl = value; this.log.info(`serverUrl: ${value}`); this.changed(); } } + /** + * The config server url that all configuration will be retrieved from. + * @returns {string} + */ + public get configServerUrl(): string { + return this._configServerUrl; + } + + /** + * The config server url that all configuration will be retrieved from. + * @param value + */ + public set configServerUrl(value: string) { + if (!!value) { + this._configServerUrl = value; + this.log.info(`configServerUrl: ${value}`); + this.changed(); + } + } + /** * The heartbeat server url that all heartbeats will be sent to. * @returns {string} diff --git a/src/configuration/IConfigurationSettings.ts b/src/configuration/IConfigurationSettings.ts index dd5fed8e..08619744 100644 --- a/src/configuration/IConfigurationSettings.ts +++ b/src/configuration/IConfigurationSettings.ts @@ -12,6 +12,7 @@ import { ISubmissionClient } from '../submission/ISubmissionClient'; export interface IConfigurationSettings { apiKey?: string; serverUrl?: string; + configServerUrl?: string; heartbeatServerUrl?: string; updateSettingsWhenIdleInterval?: number; includePrivateInformation?: boolean; diff --git a/src/submission/DefaultSubmissionClient.ts b/src/submission/DefaultSubmissionClient.ts index 08d3ca57..254a6531 100644 --- a/src/submission/DefaultSubmissionClient.ts +++ b/src/submission/DefaultSubmissionClient.ts @@ -32,7 +32,7 @@ export class DefaultSubmissionClient implements ISubmissionClient { } public getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void { - const request = this.createRequest(config, 'GET', `${config.serverUrl}/api/v2/projects/config?v=${version}`); + const request = this.createRequest(config, 'GET', `${config.configServerUrl}/api/v2/projects/config?v=${version}`); const cb = (status, message, data?, headers?) => { if (status !== 200) { return callback(new SettingsResponse(false, null, -1, null, message)); From 656daa3b5d62b6efc8f544dc3e0780973ebfad0b Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 8 May 2018 21:48:18 -0500 Subject: [PATCH 4/5] Added flag to see if the configuration is currently updating --- src/configuration/SettingsManager.ts | 51 ++++++++++++++++------------ 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/src/configuration/SettingsManager.ts b/src/configuration/SettingsManager.ts index 426b6eca..59d9b4cb 100644 --- a/src/configuration/SettingsManager.ts +++ b/src/configuration/SettingsManager.ts @@ -8,6 +8,8 @@ interface ISettingsWithVersion { } export class SettingsManager { + private static _isUpdatingSettings: boolean = false; + /** * A list of handlers that will be fired when the settings change. * @type {Array} @@ -50,7 +52,7 @@ export class SettingsManager { } public static updateSettings(config: Configuration, version?: number): void { - if (!config || !config.enabled) { + if (!config || !config.enabled || this._isUpdatingSettings) { return; } @@ -65,34 +67,39 @@ export class SettingsManager { } config.log.info(`Checking for updated settings from: v${version}.`); + this._isUpdatingSettings = true; config.submissionClient.getSettings(config, version, (response: SettingsResponse) => { - if (!config || !response || !response.success || !response.settings) { - config.log.warn(`${unableToUpdateMessage}: ${response.message}`); - return; - } + try { + if (!config || !response || !response.success || !response.settings) { + config.log.warn(`${unableToUpdateMessage}: ${response.message}`); + return; + } - config.settings = Utils.merge(config.settings, response.settings); + config.settings = Utils.merge(config.settings, response.settings); - // TODO: Store snapshot of settings after reading from config and attributes and use that to revert to defaults. - // Remove any existing server settings that are not in the new server settings. - const savedServerSettings = SettingsManager.getSavedServerSettings(config); - for (const key in savedServerSettings) { - if (response.settings[key]) { - continue; - } + // TODO: Store snapshot of settings after reading from config and attributes and use that to revert to defaults. + // Remove any existing server settings that are not in the new server settings. + const savedServerSettings = SettingsManager.getSavedServerSettings(config); + for (const key in savedServerSettings) { + if (response.settings[key]) { + continue; + } - delete config.settings[key]; - } + delete config.settings[key]; + } - const newSettings: ISettingsWithVersion = { - version: response.settingsVersion, - settings: response.settings - }; + const newSettings: ISettingsWithVersion = { + version: response.settingsVersion, + settings: response.settings + }; - config.storage.settings.save(newSettings); + config.storage.settings.save(newSettings); - config.log.info(`Updated settings: v${newSettings.version}`); - this.changed(config); + config.log.info(`Updated settings: v${newSettings.version}`); + this.changed(config); + } finally { + this._isUpdatingSettings = false; + } }); } From d48098e880c8b5a2923a9136eaf0edfdee19a734 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 8 May 2018 21:50:42 -0500 Subject: [PATCH 5/5] Fixed formatting (linting) --- src/ExceptionlessClient.ts | 4 +- src/configuration/Configuration.ts | 2 +- .../default/DuplicateCheckerPlugin-spec.ts | 2 +- .../default/ErrorPlugin-spec-exceptions.ts | 306 +++++++++--------- .../default/EventExclusionPlugin-spec.ts | 4 +- src/plugins/default/EventExclusionPlugin.ts | 2 +- src/queue/DefaultEventQueue-spec.ts | 2 +- src/services/DefaultErrorParser.ts | 2 +- src/submission/DefaultSubmissionAdapter.ts | 2 +- .../DefaultSubmissionClient-spec.ts | 2 +- src/submission/DefaultSubmissionClient.ts | 4 +- 11 files changed, 166 insertions(+), 166 deletions(-) diff --git a/src/ExceptionlessClient.ts b/src/ExceptionlessClient.ts index 051ae4e9..b17c3d48 100644 --- a/src/ExceptionlessClient.ts +++ b/src/ExceptionlessClient.ts @@ -28,11 +28,11 @@ export class ExceptionlessClient { constructor(settingsOrApiKey?: IConfigurationSettings | string, serverUrl?: string) { this.config = typeof settingsOrApiKey === 'object' ? new Configuration(settingsOrApiKey) - : new Configuration({ apiKey: settingsOrApiKey as string, serverUrl }); + : new Configuration({ apiKey: settingsOrApiKey as string, serverUrl }); this.updateSettingsTimer(5000); this.config.onChanged((config) => this.updateSettingsTimer(this._timeoutId > 0 ? 5000 : 0)); - this.config.queue.onEventsPosted((events, response) => this.updateSettingsTimer()); + this.config.queue.onEventsPosted((events, response) => this.updateSettingsTimer()); } public createException(exception: Error): EventBuilder { diff --git a/src/configuration/Configuration.ts b/src/configuration/Configuration.ts index c69ffeb9..13768592 100644 --- a/src/configuration/Configuration.ts +++ b/src/configuration/Configuration.ts @@ -503,7 +503,7 @@ export class Configuration implements IConfigurationSettings { */ public addPlugin(name: string, priority: number, pluginAction: (context: EventPluginContext, next?: () => void) => void): void; public addPlugin(pluginOrName: IEventPlugin | string, priority?: number, pluginAction?: (context: EventPluginContext, next?: () => void) => void): void { - const plugin: IEventPlugin = !!pluginAction ? { name: pluginOrName as string, priority, run: pluginAction } : pluginOrName as IEventPlugin; + const plugin: IEventPlugin = !!pluginAction ? { name: pluginOrName as string, priority, run: pluginAction } : pluginOrName as IEventPlugin; if (!plugin || !plugin.run) { this.log.error('Add plugin failed: Run method not defined'); return; diff --git a/src/plugins/default/DuplicateCheckerPlugin-spec.ts b/src/plugins/default/DuplicateCheckerPlugin-spec.ts index f2db0666..b0f7948a 100644 --- a/src/plugins/default/DuplicateCheckerPlugin-spec.ts +++ b/src/plugins/default/DuplicateCheckerPlugin-spec.ts @@ -34,7 +34,7 @@ describe('DuplicateCheckerPlugin', () => { expect(contextOfSecondRun.event.count).to.equal(1); done(); - }, 100); + }, 100); }); diff --git a/src/plugins/default/ErrorPlugin-spec-exceptions.ts b/src/plugins/default/ErrorPlugin-spec-exceptions.ts index 3fde3dc7..d849261f 100644 --- a/src/plugins/default/ErrorPlugin-spec-exceptions.ts +++ b/src/plugins/default/ErrorPlugin-spec-exceptions.ts @@ -2,174 +2,174 @@ export let CapturedExceptions: any = {}; CapturedExceptions.OPERA_854 = { 'message': 'Statement on line 44: Type mismatch (usually a non-object value used where an object is required)\n' + - 'Backtrace:\n' + - ' Line 44 of linked script http://path/to/file.js\n' + - ' this.undef();\n' + - ' Line 31 of linked script http://path/to/file.js\n' + - ' ex = ex || this.createException();\n' + - ' Line 18 of linked script http://path/to/file.js\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - ' Line 4 of inline#1 script in http://path/to/file.js\n' + - ' printTrace(printStackTrace());\n' + - ' Line 7 of inline#1 script in http://path/to/file.js\n' + - ' bar(n - 1);\n' + - ' Line 11 of inline#1 script in http://path/to/file.js\n' + - ' bar(2);\n' + - ' Line 15 of inline#1 script in http://path/to/file.js\n' + - ' foo();\n' + - '', + 'Backtrace:\n' + + ' Line 44 of linked script http://path/to/file.js\n' + + ' this.undef();\n' + + ' Line 31 of linked script http://path/to/file.js\n' + + ' ex = ex || this.createException();\n' + + ' Line 18 of linked script http://path/to/file.js\n' + + ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + + ' Line 4 of inline#1 script in http://path/to/file.js\n' + + ' printTrace(printStackTrace());\n' + + ' Line 7 of inline#1 script in http://path/to/file.js\n' + + ' bar(n - 1);\n' + + ' Line 11 of inline#1 script in http://path/to/file.js\n' + + ' bar(2);\n' + + ' Line 15 of inline#1 script in http://path/to/file.js\n' + + ' foo();\n' + + '', 'opera#sourceloc': 44 }; CapturedExceptions.OPERA_902 = { 'message': 'Statement on line 44: Type mismatch (usually a non-object value used where an object is required)\n' + - 'Backtrace:\n' + - ' Line 44 of linked script http://path/to/file.js\n' + - ' this.undef();\n' + - ' Line 31 of linked script http://path/to/file.js\n' + - ' ex = ex || this.createException();\n' + - ' Line 18 of linked script http://path/to/file.js\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - ' Line 4 of inline#1 script in http://path/to/file.js\n' + - ' printTrace(printStackTrace());\n' + - ' Line 7 of inline#1 script in http://path/to/file.js\n' + - ' bar(n - 1);\n' + - ' Line 11 of inline#1 script in http://path/to/file.js\n' + - ' bar(2);\n' + - ' Line 15 of inline#1 script in http://path/to/file.js\n' + - ' foo();\n' + - '', + 'Backtrace:\n' + + ' Line 44 of linked script http://path/to/file.js\n' + + ' this.undef();\n' + + ' Line 31 of linked script http://path/to/file.js\n' + + ' ex = ex || this.createException();\n' + + ' Line 18 of linked script http://path/to/file.js\n' + + ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + + ' Line 4 of inline#1 script in http://path/to/file.js\n' + + ' printTrace(printStackTrace());\n' + + ' Line 7 of inline#1 script in http://path/to/file.js\n' + + ' bar(n - 1);\n' + + ' Line 11 of inline#1 script in http://path/to/file.js\n' + + ' bar(2);\n' + + ' Line 15 of inline#1 script in http://path/to/file.js\n' + + ' foo();\n' + + '', 'opera#sourceloc': 44 }; CapturedExceptions.OPERA_927 = { 'message': 'Statement on line 43: Type mismatch (usually a non-object value used where an object is required)\n' + - 'Backtrace:\n' + - ' Line 43 of linked script http://path/to/file.js\n' + - ' bar(n - 1);\n' + - ' Line 31 of linked script http://path/to/file.js\n' + - ' bar(2);\n' + - ' Line 18 of linked script http://path/to/file.js\n' + - ' foo();\n' + - '', + 'Backtrace:\n' + + ' Line 43 of linked script http://path/to/file.js\n' + + ' bar(n - 1);\n' + + ' Line 31 of linked script http://path/to/file.js\n' + + ' bar(2);\n' + + ' Line 18 of linked script http://path/to/file.js\n' + + ' foo();\n' + + '', 'opera#sourceloc': 43 }; CapturedExceptions.OPERA_964 = { 'message': 'Statement on line 42: Type mismatch (usually non-object value supplied where object required)\n' + - 'Backtrace:\n' + - ' Line 42 of linked script http://path/to/file.js\n' + - ' this.undef();\n' + - ' Line 27 of linked script http://path/to/file.js\n' + - ' ex = ex || this.createException();\n' + - ' Line 18 of linked script http://path/to/file.js: In function printStackTrace\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - ' Line 4 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' printTrace(printStackTrace());\n' + - ' Line 7 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' bar(n - 1);\n' + - ' Line 11 of inline#1 script in http://path/to/file.js: In function foo\n' + - ' bar(2);\n' + - ' Line 15 of inline#1 script in http://path/to/file.js\n' + - ' foo();\n' + - '', + 'Backtrace:\n' + + ' Line 42 of linked script http://path/to/file.js\n' + + ' this.undef();\n' + + ' Line 27 of linked script http://path/to/file.js\n' + + ' ex = ex || this.createException();\n' + + ' Line 18 of linked script http://path/to/file.js: In function printStackTrace\n' + + ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + + ' Line 4 of inline#1 script in http://path/to/file.js: In function bar\n' + + ' printTrace(printStackTrace());\n' + + ' Line 7 of inline#1 script in http://path/to/file.js: In function bar\n' + + ' bar(n - 1);\n' + + ' Line 11 of inline#1 script in http://path/to/file.js: In function foo\n' + + ' bar(2);\n' + + ' Line 15 of inline#1 script in http://path/to/file.js\n' + + ' foo();\n' + + '', 'opera#sourceloc': 42, 'stacktrace': ' ... Line 27 of linked script http://path/to/file.js\n' + - ' ex = ex || this.createException();\n' + - ' Line 18 of linked script http://path/to/file.js: In function printStackTrace\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - ' Line 4 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' printTrace(printStackTrace());\n' + - ' Line 7 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' bar(n - 1);\n' + - ' Line 11 of inline#1 script in http://path/to/file.js: In function foo\n' + - ' bar(2);\n' + - ' Line 15 of inline#1 script in http://path/to/file.js\n' + - ' foo();\n' + - '' + ' ex = ex || this.createException();\n' + + ' Line 18 of linked script http://path/to/file.js: In function printStackTrace\n' + + ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + + ' Line 4 of inline#1 script in http://path/to/file.js: In function bar\n' + + ' printTrace(printStackTrace());\n' + + ' Line 7 of inline#1 script in http://path/to/file.js: In function bar\n' + + ' bar(n - 1);\n' + + ' Line 11 of inline#1 script in http://path/to/file.js: In function foo\n' + + ' bar(2);\n' + + ' Line 15 of inline#1 script in http://path/to/file.js\n' + + ' foo();\n' + + '' }; CapturedExceptions.OPERA_10 = { 'message': 'Statement on line 42: Type mismatch (usually non-object value supplied where object required)', 'opera#sourceloc': 42, 'stacktrace': ' Line 42 of linked script http://path/to/file.js\n' + - ' this.undef();\n' + - ' Line 27 of linked script http://path/to/file.js\n' + - ' ex = ex || this.createException();\n' + - ' Line 18 of linked script http://path/to/file.js: In function printStackTrace\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - ' Line 4 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' printTrace(printStackTrace());\n' + - ' Line 7 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' bar(n - 1);\n' + - ' Line 11 of inline#1 script in http://path/to/file.js: In function foo\n' + - ' bar(2);\n' + - ' Line 15 of inline#1 script in http://path/to/file.js\n' + - ' foo();\n' + - '' + ' this.undef();\n' + + ' Line 27 of linked script http://path/to/file.js\n' + + ' ex = ex || this.createException();\n' + + ' Line 18 of linked script http://path/to/file.js: In function printStackTrace\n' + + ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + + ' Line 4 of inline#1 script in http://path/to/file.js: In function bar\n' + + ' printTrace(printStackTrace());\n' + + ' Line 7 of inline#1 script in http://path/to/file.js: In function bar\n' + + ' bar(n - 1);\n' + + ' Line 11 of inline#1 script in http://path/to/file.js: In function foo\n' + + ' bar(2);\n' + + ' Line 15 of inline#1 script in http://path/to/file.js\n' + + ' foo();\n' + + '' }; CapturedExceptions.OPERA_11 = { message: '\'this.undef\' is not a function', stack: '([arguments not available])@http://path/to/file.js:27\n' + - 'bar([arguments not available])@http://domain.com:1234/path/to/file.js:18\n' + - 'foo([arguments not available])@http://domain.com:1234/path/to/file.js:11\n' + - '@http://path/to/file.js:15\n' + - 'Error created at @http://path/to/file.js:15', + 'bar([arguments not available])@http://domain.com:1234/path/to/file.js:18\n' + + 'foo([arguments not available])@http://domain.com:1234/path/to/file.js:11\n' + + '@http://path/to/file.js:15\n' + + 'Error created at @http://path/to/file.js:15', stacktrace: 'Error thrown at line 42, column 12 in () in http://path/to/file.js:\n' + - ' this.undef();\n' + - 'called from line 27, column 8 in (ex) in http://path/to/file.js:\n' + - ' ex = ex || this.createException();\n' + - 'called from line 18, column 4 in printStackTrace(options) in http://path/to/file.js:\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - 'called from line 4, column 5 in bar(n) in http://path/to/file.js:\n' + - ' printTrace(printStackTrace());\n' + - 'called from line 7, column 4 in bar(n) in http://path/to/file.js:\n' + - ' bar(n - 1);\n' + - 'called from line 11, column 4 in foo() in http://path/to/file.js:\n' + - ' bar(2);\n' + - 'called from line 15, column 3 in http://path/to/file.js:\n' + - ' foo();' + ' this.undef();\n' + + 'called from line 27, column 8 in (ex) in http://path/to/file.js:\n' + + ' ex = ex || this.createException();\n' + + 'called from line 18, column 4 in printStackTrace(options) in http://path/to/file.js:\n' + + ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + + 'called from line 4, column 5 in bar(n) in http://path/to/file.js:\n' + + ' printTrace(printStackTrace());\n' + + 'called from line 7, column 4 in bar(n) in http://path/to/file.js:\n' + + ' bar(n - 1);\n' + + 'called from line 11, column 4 in foo() in http://path/to/file.js:\n' + + ' bar(2);\n' + + 'called from line 15, column 3 in http://path/to/file.js:\n' + + ' foo();' }; CapturedExceptions.OPERA_12 = { message: 'Cannot convert \'x\' to object', stack: '([arguments not available])@http://localhost:8000/ExceptionLab.html:48\n' + - 'dumpException3([arguments not available])@http://localhost:8000/ExceptionLab.html:46\n' + - '([arguments not available])@http://localhost:8000/ExceptionLab.html:1', + 'dumpException3([arguments not available])@http://localhost:8000/ExceptionLab.html:46\n' + + '([arguments not available])@http://localhost:8000/ExceptionLab.html:1', stacktrace: 'Error thrown at line 48, column 12 in (x) in http://localhost:8000/ExceptionLab.html:\n' + - ' x.undef();\n' + - 'called from line 46, column 8 in dumpException3() in http://localhost:8000/ExceptionLab.html:\n' + - ' dumpException((function(x) {\n' + - 'called from line 1, column 0 in (event) in http://localhost:8000/ExceptionLab.html:\n' + - ' dumpException3();' + ' x.undef();\n' + + 'called from line 46, column 8 in dumpException3() in http://localhost:8000/ExceptionLab.html:\n' + + ' dumpException((function(x) {\n' + + 'called from line 1, column 0 in (event) in http://localhost:8000/ExceptionLab.html:\n' + + ' dumpException3();' }; CapturedExceptions.OPERA_25 = { message: 'Cannot read property \'undef\' of null', name: 'TypeError', stack: 'TypeError: Cannot read property \'undef\' of null\n' + - ' at http://path/to/file.js:47:22\n' + - ' at foo (http://path/to/file.js:52:15)\n' + - ' at bar (http://path/to/file.js:108:168)' + ' at http://path/to/file.js:47:22\n' + + ' at foo (http://path/to/file.js:52:15)\n' + + ' at bar (http://path/to/file.js:108:168)' }; CapturedExceptions.CHROME_15 = { arguments: ['undef'], message: 'Object # has no method \'undef\'', stack: 'TypeError: Object # has no method \'undef\'\n' + - ' at bar (http://path/to/file.js:13:17)\n' + - ' at bar (http://path/to/file.js:16:5)\n' + - ' at foo (http://path/to/file.js:20:5)\n' + - ' at http://path/to/file.js:24:4' + ' at bar (http://path/to/file.js:13:17)\n' + + ' at bar (http://path/to/file.js:16:5)\n' + + ' at foo (http://path/to/file.js:20:5)\n' + + ' at http://path/to/file.js:24:4' }; CapturedExceptions.CHROME_36 = { message: 'Default error', name: 'Error', stack: 'Error: Default error\n' + - ' at dumpExceptionError (http://localhost:8080/file.js:41:27)\n' + - ' at HTMLButtonElement.onclick (http://localhost:8080/file.js:107:146)' + ' at dumpExceptionError (http://localhost:8080/file.js:41:27)\n' + + ' at HTMLButtonElement.onclick (http://localhost:8080/file.js:107:146)' }; CapturedExceptions.FIREFOX_3 = { @@ -178,34 +178,34 @@ CapturedExceptions.FIREFOX_3 = { message: 'this.undef is not a function', name: 'TypeError', stack: '()@http://127.0.0.1:8000/js/stacktrace.js:44\n' + - '(null)@http://127.0.0.1:8000/js/stacktrace.js:31\n' + - 'printStackTrace()@http://127.0.0.1:8000/js/stacktrace.js:18\n' + - 'bar(1)@http://127.0.0.1:8000/js/file.js:13\n' + - 'bar(2)@http://127.0.0.1:8000/js/file.js:16\n' + - 'foo()@http://127.0.0.1:8000/js/file.js:20\n' + - '@http://127.0.0.1:8000/js/file.js:24\n' + - '' + '(null)@http://127.0.0.1:8000/js/stacktrace.js:31\n' + + 'printStackTrace()@http://127.0.0.1:8000/js/stacktrace.js:18\n' + + 'bar(1)@http://127.0.0.1:8000/js/file.js:13\n' + + 'bar(2)@http://127.0.0.1:8000/js/file.js:16\n' + + 'foo()@http://127.0.0.1:8000/js/file.js:20\n' + + '@http://127.0.0.1:8000/js/file.js:24\n' + + '' }; CapturedExceptions.FIREFOX_7 = { fileName: 'file:///G:/js/stacktrace.js', lineNumber: 44, stack: '()@file:///G:/js/stacktrace.js:44\n' + - '(null)@file:///G:/js/stacktrace.js:31\n' + - 'printStackTrace()@file:///G:/js/stacktrace.js:18\n' + - 'bar(1)@file:///G:/js/file.js:13\n' + - 'bar(2)@file:///G:/js/file.js:16\n' + - 'foo()@file:///G:/js/file.js:20\n' + - '@file:///G:/js/file.js:24\n' + - '' + '(null)@file:///G:/js/stacktrace.js:31\n' + + 'printStackTrace()@file:///G:/js/stacktrace.js:18\n' + + 'bar(1)@file:///G:/js/file.js:13\n' + + 'bar(2)@file:///G:/js/file.js:16\n' + + 'foo()@file:///G:/js/file.js:20\n' + + '@file:///G:/js/file.js:24\n' + + '' }; CapturedExceptions.FIREFOX_14 = { message: 'x is null', stack: '@http://path/to/file.js:48\n' + - 'dumpException3@http://path/to/file.js:52\n' + - 'onclick@http://path/to/file.js:1\n' + - '', + 'dumpException3@http://path/to/file.js:52\n' + + 'onclick@http://path/to/file.js:1\n' + + '', fileName: 'http://path/to/file.js', lineNumber: 48 }; @@ -214,8 +214,8 @@ CapturedExceptions.FIREFOX_31 = { message: 'Default error', name: 'Error', stack: 'foo@http://path/to/file.js:41:13\n' + - 'bar@http://path/to/file.js:1:1\n' + - '', + 'bar@http://path/to/file.js:1:1\n' + + '', fileName: 'http://path/to/file.js', lineNumber: 41, columnNumber: 12 @@ -224,9 +224,9 @@ CapturedExceptions.FIREFOX_31 = { CapturedExceptions.SAFARI_6 = { message: '\'null\' is not an object (evaluating \'x.undef\')', stack: '@http://path/to/file.js:48\n' + - 'dumpException3@http://path/to/file.js:52\n' + - 'onclick@http://path/to/file.js:82\n' + - '[native code]', + 'dumpException3@http://path/to/file.js:52\n' + + 'onclick@http://path/to/file.js:82\n' + + '[native code]', line: 48, sourceURL: 'http://path/to/file.js' }; @@ -235,8 +235,8 @@ CapturedExceptions.SAFARI_7 = { message: '\'null\' is not an object (evaluating \'x.undef\')', name: 'TypeError', stack: 'http://path/to/file.js:48:22\n' + - 'foo@http://path/to/file.js:52:15\n' + - 'bar@http://path/to/file.js:108:107', + 'foo@http://path/to/file.js:52:15\n' + + 'bar@http://path/to/file.js:108:107', line: 47, sourceURL: 'http://path/to/file.js' }; @@ -245,8 +245,8 @@ CapturedExceptions.SAFARI_8 = { message: 'null is not an object (evaluating \'x.undef\')', name: 'TypeError', stack: 'http://path/to/file.js:47:22\n' + - 'foo@http://path/to/file.js:52:15\n' + - 'bar@http://path/to/file.js:108:23', + 'foo@http://path/to/file.js:52:15\n' + + 'bar@http://path/to/file.js:108:23', line: 47, column: 22, sourceURL: 'http://path/to/file.js' @@ -256,9 +256,9 @@ CapturedExceptions.SAFARI_8_EVAL = { message: 'Can\'t find variable: getExceptionProps', name: 'ReferenceError', stack: 'eval code\n' + - 'eval@[native code]\n' + - 'foo@http://path/to/file.js:58:21\n' + - 'bar@http://path/to/file.js:109:91', + 'eval@[native code]\n' + + 'foo@http://path/to/file.js:58:21\n' + + 'bar@http://path/to/file.js:109:91', line: 1, column: 18 }; @@ -271,9 +271,9 @@ CapturedExceptions.IE_9 = { CapturedExceptions.IE_10 = { message: 'Unable to get property \'undef\' of undefined or null reference', stack: 'TypeError: Unable to get property \'undef\' of undefined or null reference\n' + - ' at Anonymous function (http://path/to/file.js:48:13)\n' + - ' at foo (http://path/to/file.js:46:9)\n' + - ' at bar (http://path/to/file.js:82:1)', + ' at Anonymous function (http://path/to/file.js:48:13)\n' + + ' at foo (http://path/to/file.js:46:9)\n' + + ' at bar (http://path/to/file.js:82:1)', description: 'Unable to get property \'undef\' of undefined or null reference', number: -2146823281 }; @@ -282,9 +282,9 @@ CapturedExceptions.IE_11 = { message: 'Unable to get property \'undef\' of undefined or null reference', name: 'TypeError', stack: 'TypeError: Unable to get property \'undef\' of undefined or null reference\n' + - ' at Anonymous function (http://path/to/file.js:47:21)\n' + - ' at foo (http://path/to/file.js:45:13)\n' + - ' at bar (http://path/to/file.js:108:1)', + ' at Anonymous function (http://path/to/file.js:47:21)\n' + + ' at foo (http://path/to/file.js:45:13)\n' + + ' at bar (http://path/to/file.js:108:1)', description: 'Unable to get property \'undef\' of undefined or null reference', number: -2146823281 }; @@ -293,9 +293,9 @@ CapturedExceptions.IE_11_EVAL = { message: '\'getExceptionProps\' is undefined', name: 'ReferenceError', stack: 'ReferenceError: \'getExceptionProps\' is undefined\n' + - ' at eval code (eval code:1:1)\n' + - ' at foo (http://path/to/file.js:58:17)\n' + - ' at bar (http://path/to/file.js:109:1)', + ' at eval code (eval code:1:1)\n' + + ' at foo (http://path/to/file.js:58:17)\n' + + ' at bar (http://path/to/file.js:109:1)', description: '\'getExceptionProps\' is undefined', number: -2146823279 }; diff --git a/src/plugins/default/EventExclusionPlugin-spec.ts b/src/plugins/default/EventExclusionPlugin-spec.ts index 44de61fb..6fbd9a5e 100644 --- a/src/plugins/default/EventExclusionPlugin-spec.ts +++ b/src/plugins/default/EventExclusionPlugin-spec.ts @@ -34,7 +34,7 @@ describe('EventExclusionPlugin', () => { it('[Trace] Test (source min level: false)', () => { expect(run('Test', 'Trace', '@@log:Test', 'false')).to.be.true; }); it('[Trace] Test (source min level: no)', () => { expect(run('Test', 'Trace', '@@log:Test', 'no')).to.be.true; }); it('[Trace] Test (source min level: 0)', () => { expect(run('Test', 'Trace', '@@log:Test', '0')).to.be.true; }); - it('[Trace] Test (source min level: true)', () => {expect(run('Test', 'Trace', '@@log:Test', 'true')).to.be.false; }); + it('[Trace] Test (source min level: true)', () => { expect(run('Test', 'Trace', '@@log:Test', 'true')).to.be.false; }); it('[Trace] Test (source min level: yes)', () => { expect(run('Test', 'Trace', '@@log:Test', 'yes')).to.be.false; }); it('[Trace] Test (source min level: 1)', () => { expect(run('Test', 'Trace', '@@log:Test', '1')).to.be.false; }); it('[Trace] Test (source min level: Debug)', () => { expect(run('Test', 'Trace', '@@log:Test', 'Debug')).to.be.true; }); @@ -116,7 +116,7 @@ describe('EventExclusionPlugin', () => { } const errorParser = new DefaultErrorParser(); - const context = new EventPluginContext(client, { type: 'error', data: { } }); + const context = new EventPluginContext(client, { type: 'error', data: {} }); context.event.data['@error'] = errorParser.parse(context, createException()); const plugin = new EventExclusionPlugin(); diff --git a/src/plugins/default/EventExclusionPlugin.ts b/src/plugins/default/EventExclusionPlugin.ts index bf81d46b..8323f08c 100644 --- a/src/plugins/default/EventExclusionPlugin.ts +++ b/src/plugins/default/EventExclusionPlugin.ts @@ -46,7 +46,7 @@ export class EventExclusionPlugin implements IEventPlugin { } const isLog = type === 'log'; - const sourcePrefix = `@@${type}:`; + const sourcePrefix = `@@${type}:`; const value = configSettings[sourcePrefix + source]; if (value) { diff --git a/src/queue/DefaultEventQueue-spec.ts b/src/queue/DefaultEventQueue-spec.ts index 6727365f..bafcd745 100644 --- a/src/queue/DefaultEventQueue-spec.ts +++ b/src/queue/DefaultEventQueue-spec.ts @@ -16,7 +16,7 @@ describe('DefaultEventQueue', () => { }); afterEach(() => { - const queue = config.queue as any; + const queue = config.queue as any; clearInterval(queue._queueTimer); config = null; xhr.restore(); diff --git a/src/services/DefaultErrorParser.ts b/src/services/DefaultErrorParser.ts index 69f8e36b..59046f2d 100644 --- a/src/services/DefaultErrorParser.ts +++ b/src/services/DefaultErrorParser.ts @@ -45,7 +45,7 @@ export class DefaultErrorParser implements IErrorParser { throw new Error('Unable to parse the exceptions stack trace.'); } - const message = typeof(exception) === 'string' ? exception as any : undefined; + const message = typeof (exception) === 'string' ? exception as any : undefined; return { type: stackTrace.name || 'Error', message: stackTrace.message || exception.message || message, diff --git a/src/submission/DefaultSubmissionAdapter.ts b/src/submission/DefaultSubmissionAdapter.ts index ff4441b7..ad1a7e8b 100644 --- a/src/submission/DefaultSubmissionAdapter.ts +++ b/src/submission/DefaultSubmissionAdapter.ts @@ -3,7 +3,7 @@ import { SubmissionCallback } from './SubmissionCallback'; import { SubmissionRequest } from './SubmissionRequest'; // tslint:disable-next-line:prefer-const -declare var XDomainRequest: { new (); create(); }; +declare var XDomainRequest: { new(); create(); }; export class DefaultSubmissionAdapter implements ISubmissionAdapter { public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) { diff --git a/src/submission/DefaultSubmissionClient-spec.ts b/src/submission/DefaultSubmissionClient-spec.ts index e2edf30a..d0626c0c 100644 --- a/src/submission/DefaultSubmissionClient-spec.ts +++ b/src/submission/DefaultSubmissionClient-spec.ts @@ -10,7 +10,7 @@ import { SubmissionRequest } from './SubmissionRequest'; class TestAdapter implements ISubmissionAdapter { private request; - private checks: Array<(request: SubmissionRequest) => void > = []; + private checks: Array<(request: SubmissionRequest) => void> = []; private callback: SubmissionCallback; private status = 202; private message = null; diff --git a/src/submission/DefaultSubmissionClient.ts b/src/submission/DefaultSubmissionClient.ts index 254a6531..2b674c64 100644 --- a/src/submission/DefaultSubmissionClient.ts +++ b/src/submission/DefaultSubmissionClient.ts @@ -9,14 +9,14 @@ import { SubmissionRequest } from './SubmissionRequest'; import { SubmissionResponse } from './SubmissionResponse'; // tslint:disable-next-line:prefer-const -declare var XDomainRequest: { new (); create(); }; +declare var XDomainRequest: { new(); create(); }; export class DefaultSubmissionClient implements ISubmissionClient { public configurationVersionHeader: string = 'x-exceptionless-configversion'; public postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void { const data = JSON.stringify(events); - const request = this.createRequest(config, 'POST', `${config.serverUrl}/api/v2/events`, data); + const request = this.createRequest(config, 'POST', `${config.serverUrl}/api/v2/events`, data); const cb = this.createSubmissionCallback(config, callback); return config.submissionAdapter.sendRequest(request, cb, isAppExiting);