mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Merge pull request #225 from rschamp/bugfix/GH-224
Use XDR when making cross-origin api requests
This commit is contained in:
commit
e25eb1fc90
1 changed files with 6 additions and 0 deletions
|
@ -26,6 +26,12 @@ var Api = {
|
||||||
opts.uri = opts.host + opts.uri;
|
opts.uri = opts.host + opts.uri;
|
||||||
|
|
||||||
var apiRequest = function (opts) {
|
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) {
|
xhr(opts, function (err, res, body) {
|
||||||
if (err) log.error(err);
|
if (err) log.error(err);
|
||||||
callback(err, body);
|
callback(err, body);
|
||||||
|
|
Loading…
Reference in a new issue