Files
raspberryGPIOhtmlserver/node_modules/has-cors/index.js
2016-06-21 18:42:57 +02:00

24 lines
458 B
JavaScript
Executable File

/**
* Module dependencies.
*/
var global = require('global');
/**
* Module exports.
*
* Logic borrowed from Modernizr:
*
* - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js
*/
try {
module.exports = 'XMLHttpRequest' in global &&
'withCredentials' in new global.XMLHttpRequest();
} catch (err) {
// if XMLHttp support is disabled in IE then it will throw
// when trying to create
module.exports = false;
}