How can I force window.AP.request to always add header x-atlassian-force-account-id: true
to every request that I make from the plugin? I tried to override XMLHttpRequest’s send method but with no luck.
XMLHttpRequest.prototype.realSend = XMLHttpRequest.prototype.send;
var newSend = function(vData) {
this.setRequestHeader('x-atlassian-force-account-id', true);
this.realSend(vData);
};
XMLHttpRequest.prototype.send = newSend;