Skip to content

Commit

Permalink
[fix] Obfuscate ActiveXObject occurrences (#509)
Browse files Browse the repository at this point in the history
Some corporate firewalls/proxies such as Blue Coat prevent JavaScript
files from being downloaded if they contain the word "ActiveX".
  • Loading branch information
lpinca authored and darrachequesne committed Oct 23, 2016
1 parent 6187585 commit 7acae3d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/xmlhttprequest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// browser shim for xmlhttprequest module

// Indicate to eslint that ActiveXObject is global
/* global ActiveXObject */

var hasCORS = require('has-cors');

module.exports = function (opts) {
Expand Down Expand Up @@ -34,7 +31,7 @@ module.exports = function (opts) {

if (!xdomain) {
try {
return new ActiveXObject('Microsoft.XMLHTTP');
return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');
} catch (e) { }
}
};

0 comments on commit 7acae3d

Please sign in to comment.