Skip to content

Commit

Permalink
Add apiURL overloading to ping
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamish-taylor committed May 17, 2024
1 parent 9801942 commit 54e087d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/raygun.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ var raygunFactory = function (window, $, undefined) {
_trackViewportDimensions = options.trackViewportDimensions === undefined ? true : options.trackViewportDimensions;

if (options.apiUrl) {
_raygunApiUrl = options.apiUrl;
_customEndpointSet = true;
this.Options._raygunApiUrl = options.apiUrl;
this.Options._customEndpointSet = true;
}

if (typeof options.wrapAsynchronousCallbacks !== 'undefined') {
Expand All @@ -151,8 +151,8 @@ var raygunFactory = function (window, $, undefined) {
}

if (options.apiEndpoint) {
_raygunApiUrl = options.apiEndpoint;
_customEndpointSet = true;
this.Options._raygunApiUrl = options.apiEndpoint;
this.Options._customEndpointSet = true;
}

if (options.from) {
Expand Down Expand Up @@ -500,7 +500,7 @@ var raygunFactory = function (window, $, undefined) {
var startRum = function () {
_rum = new Raygun.RealUserMonitoring(
Raygun.Options._raygunApiKey,
_raygunApiUrl,
Raygun.Options._raygunApiUrl,
makePostCorsRequest,
_user,
_version,
Expand Down Expand Up @@ -978,7 +978,7 @@ var raygunFactory = function (window, $, undefined) {
}

Raygun.Utilities.log('Sending exception data to Raygun:', data);
var url = _raygunApiUrl + '/entries?apikey=' + encodeURIComponent(Raygun.Options._raygunApiKey);
var url = Raygun.Options._raygunApiUrl + '/entries?apikey=' + encodeURIComponent(Raygun.Options._raygunApiKey);
makePostCorsRequest(url, JSON.stringify(data));
}

Expand Down
2 changes: 1 addition & 1 deletion src/raygun.loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
clearInterval(metadata.ping.pingIntervalId);
}

var url = "https://api.raygun.io/ping?apiKey=" + encodeURIComponent(Raygun.Options._raygunApiKey);
var url = Raygun.Options._raygunApiUrl + "/ping?apiKey=" + encodeURIComponent(Raygun.Options._raygunApiKey);
var data = {
crashReportingEnabled: crashReportingEnabled || false,
realUserMonitoringEnabled: realUserMonitoringEnabled || false,
Expand Down

0 comments on commit 54e087d

Please sign in to comment.