falcor-http-datasource
Version:
This package contains falcor components for use in browsers.
13 lines (12 loc) • 363 B
JavaScript
;
// Get CORS support even for older IE
module.exports = function getCORSRequest() {
var xhr = new global.XMLHttpRequest();
if ('withCredentials' in xhr) {
return xhr;
} else if (!!global.XDomainRequest) {
return new XDomainRequest();
} else {
throw new Error('CORS is not supported by your browser');
}
};