message: fix: Fix IE/Android request headers tests
diff: @@ -1392,8 +1392,8 @@ describe('globals', function() {
  });
  });
  - it('should apply globalOptions.headers if specified', function() {
  - this.sinon.stub(Raven, 'isSetup').returns(true);
  + if (supportsFetch()) {
  + it('should apply globalOptions.headers with string value to fetch call if specified', function() {
  this.sinon.stub(window, 'fetch').resolves(true);
  Raven._globalProject = '2';
  @@ -1412,8 +1412,7 @@ describe('globals', function() {
  });
  });
  - it('should apply globalOptions.headers with function value if specified', function() {
  - this.sinon.stub(Raven, 'isSetup').returns(true);
  + it('should apply globalOptions.headers with function value to fetch call if specified', function() {
  this.sinon.stub(window, 'fetch').resolves(true);
  Raven._globalProject = '2';
  @@ -1433,6 +1432,36 @@ describe('globals', function() {
  'custom-header': 'computed-header-value'
  });
  });
  + }
  +
  + it('should apply globalOptions.headers with string or function value to XHR call if specified', function() {
  + var origFetch = window.fetch;
  + delete window.fetch;
  +
  + var requests = [];
  + var xhr = sinon.useFakeXMLHttpRequest();
  +
  + xhr.onCreate = function(xhr) {
  + requests.push(xhr);
  + };
  +
  + Raven._globalOptions = {
  + headers: {
  + 'custom-string-header': 'pickle-rick',
  + 'custom-function-header': function() {
  + return 'morty';
  + }
  + }
  + };
  +
  + Raven._send({message: 'bar'});
  +
  + var lastXhr = requests[requests.length - 1];
  + assert.equal(lastXhr.HEADERS_RECEIVED, 2);
  +
  + window.fetch = origFetch;
  + xhr.restore();
  + });
  it('should check `Raven.isSetup`', function() {
  this.sinon.stub(Raven, 'isSetup').returns(false);
  