aboutsummaryrefslogtreecommitdiffhomepage
path: root/node_modules/has-cors/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/has-cors/index.js')
-rw-r--r--node_modules/has-cors/index.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/node_modules/has-cors/index.js b/node_modules/has-cors/index.js
new file mode 100644
index 0000000..952a7c8
--- /dev/null
+++ b/node_modules/has-cors/index.js
@@ -0,0 +1,17 @@
+
+/**
+ * Module exports.
+ *
+ * Logic borrowed from Modernizr:
+ *
+ * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js
+ */
+
+try {
+ module.exports = typeof XMLHttpRequest !== 'undefined' &&
+ 'withCredentials' in new XMLHttpRequest();
+} catch (err) {
+ // if XMLHttp support is disabled in IE then it will throw
+ // when trying to create
+ module.exports = false;
+}