Merge pull request #225 from rschamp/bugfix/GH-224

Use XDR when making cross-origin api requests
This commit is contained in:
Ray Schamp 2015-11-11 11:10:23 -05:00
commit e25eb1fc90

View file

@ -26,6 +26,12 @@ var Api = {
opts.uri = opts.host + opts.uri;
var apiRequest = function (opts) {
if (opts.host !== '') {
// For IE < 10, we must use XDR for cross-domain requests. XDR does not support
// custom headers.
defaults(opts, {useXDR: true});
opts.headers = {};
}
xhr(opts, function (err, res, body) {
if (err) log.error(err);
callback(err, body);