socketioMEANseed/server/node_modules/has-cors/index.js
server/node_modules/has-cors/index.jsRaw
1
2/**
3 * Module exports.
4 *
5 * Logic borrowed from Modernizr:
6 *
7 * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js
8 */
9
10try {
11 module.exports = typeof XMLHttpRequest !== 'undefined' &&
12 'withCredentials' in new XMLHttpRequest();
13} catch (err) {
14 // if XMLHttp support is disabled in IE then it will throw
15 // when trying to create
16 module.exports = false;
17}