has-cors.js 324 B

1234567891011
  1. // imported from https://github.com/component/has-cors
  2. let value = false;
  3. try {
  4. value = typeof XMLHttpRequest !== 'undefined' &&
  5. 'withCredentials' in new XMLHttpRequest();
  6. }
  7. catch (err) {
  8. // if XMLHttp support is disabled in IE then it will throw
  9. // when trying to create
  10. }
  11. export const hasCORS = value;