arnaucube
arnaucube/raspberryGPIOhtmlserverPublic Self-hosted repository
raspberryGPIOhtmlserver/node_modules/has-cors/index.js
node_modules/has-cors/index.jsRaw
 1
 2/**
 3 * Module dependencies.
 4 */
 5
 6var global = require('global');
 7
 8/**
 9 * Module exports.
10 *
11 * Logic borrowed from Modernizr:
12 *
13 *   - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js
14 */
15
16try {
17  module.exports = 'XMLHttpRequest' in global &&
18    'withCredentials' in new global.XMLHttpRequest();
19} catch (err) {
20  // if XMLHttp support is disabled in IE then it will throw
21  // when trying to create
22  module.exports = false;
23}