Skip to content

Commit

Permalink
Remove allowInsecureSubmissions option (#488)
Browse files Browse the repository at this point in the history
* Update index.js

* Update README.md

* Update raygun.js

* Remove XDomainRequest as is super obsolete

* version bump

* bad merge?!!!

* Revert "bad merge?!!!"

This reverts commit 2eb95f5.
  • Loading branch information
darcythomas committed Jun 27, 2023
1 parent 0027af2 commit b6b0920
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 37 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* v2.26.0
- Removed some dead code related to http support in IE8. As IE8 and http is [no longer supported due to security reasons](https://raygun.com/documentation/product-guides/crash-reporting/troubleshooting/#transport-layer-security-tls-compliance)

* v2.25.8
- Improve README documentation to be more clear on the protocol relative URL and how to use the CDN implemmentation without running a server .

Expand Down
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,6 @@ If you need to detach it (this will disable automatic unhandled error sending):
rg4js('detach');
```

**IE8**

If you are serving your site over HTTP and want IE8 to be able to submit JavaScript errors then you will
need to set the following setting which will allow IE8 to submit the error over HTTP. Otherwise the provider
will only submit over HTTPS which IE8 will not allow while being served over HTTP.

```javascript
rg4js('options', {
allowInsecureSubmissions: true
});
```

## Documentation

Expand All @@ -169,8 +158,6 @@ rg4js('options', {

The second parameter should contain one or more of these keys and a value to customize the behavior:

`allowInsecureSubmissions` - posts error payloads over HTTP. This allows **IE8** to send JS errors

`ignoreAjaxAbort` - User-aborted Ajax calls result in errors - if this option is true, these will not be sent.

`ignoreAjaxError` - Ajax requests that return error codes will not be sent as errors to Raygun if this options is true.
Expand Down Expand Up @@ -219,7 +206,6 @@ An example raygun4js configuration:

```javascript
rg4js('options', {
allowInsecureSubmissions: true,
ignoreAjaxAbort: true,
ignoreAjaxError: true,
debugMode: true,
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raygun4js",
"version": "2.25.8",
"version": "2.26.0",
"homepage": "http://raygun.io",
"authors": [
"Mindscape <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"title": "Raygun4js",
"description": "Raygun.com plugin for JavaScript",
"version": "2.25.8",
"version": "2.26.0",
"homepage": "https://github.com/MindscapeHQ/raygun4js",
"author": {
"name": "MindscapeHQ",
Expand Down
2 changes: 1 addition & 1 deletion raygun4js.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>raygun4js</id>
<version>2.25.8</version>
<version>2.26.0</version>
<title>Raygun4js</title>
<authors>Mindscape Limited</authors>
<owners>Mindscape Limited</owners>
Expand Down
22 changes: 3 additions & 19 deletions src/raygun.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ var raygunFactory = function(window, $, undefined) {
var _traceKit = TraceKit,
_raygun = window.Raygun,
_debugMode = false,
_allowInsecureSubmissions = false,
_ignoreAjaxAbort = false,
_ignoreAjaxError = false,
_enableOfflineSave = false,
Expand Down Expand Up @@ -112,7 +111,6 @@ var raygunFactory = function(window, $, undefined) {
}

if (options) {
_allowInsecureSubmissions = options.allowInsecureSubmissions || false;
_ignoreAjaxAbort = options.ignoreAjaxAbort || false;
_ignoreAjaxError = options.ignoreAjaxError || false;
_disableAnonymousUserTracking = options.disableAnonymousUserTracking || false;
Expand Down Expand Up @@ -968,28 +966,14 @@ var raygunFactory = function(window, $, undefined) {

// Create the XHR object.
function createCORSRequest(method, url) {
var xhr;

xhr = new window.XMLHttpRequest();
var xhr = new window.XMLHttpRequest();
xhr.timeout = 10000;

if ('withCredentials' in xhr || Raygun.Utilities.isReactNative()) {
// XHR for Chrome/Firefox/Opera/Safari
// as well as React Native's custom XHR implementation
xhr.open(method, url, true);
} else if (window.XDomainRequest) {
// XDomainRequest for IE.
if (_allowInsecureSubmissions) {
// remove 'https:' and use relative protocol
// this allows IE8 to post messages when running
// on http
url = url.slice(6);
}

xhr = new window.XDomainRequest();
xhr.open(method, url);
}

xhr.timeout = 10000;
}

return xhr;
}
Expand Down
2 changes: 1 addition & 1 deletion src/raygun.rum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ var raygunRumFactory = function (window, $, Raygun) {
return (
initiatorType === 'xmlhttprequest' ||
initiatorType === 'fetch' ||
initiatorType === 'preflight' || // 'preflight' initatorType used by Edge for CORS POST/DELETE requests
initiatorType === 'preflight' || // 'preflight' initiatorType used by Edge for CORS POST/DELETE requests
initiatorType === 'beacon' // for navigator.sendBeacon calls in Chrome/Edge. Safari doesn't record the timings and Firefox marks them as 'other'
);
}
Expand Down

0 comments on commit b6b0920

Please sign in to comment.