You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
458 B

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