runs(function () { io.setupConfig({ headers: { 'X-Requested-With': 'XMLHttpRequest' } }); });
it('support ignore X-Requested-With for all request', function () { var ok = 0; io.setupConfig({ headers: { 'X-Requested-With': false } }); io({ cache: false, dataType: 'json', url: testUrl, xhrFields: { withCredentials: true }, xdr: { // force to use native xhr no sub domain proxy subDomain: { proxy: false } }, success: function (d) { expect('X-Requested-With' in d).toBe(false); ok = 1; } }); waitsFor(function () { return ok; }); runs(function () { io.setupConfig({ headers: { 'X-Requested-With': 'XMLHttpRequest' } }); }); });