ignoreError: true,
// bypass the LinkHandler, because rewrites aren't enabled yet
url: url,
+ type: 'GET',
+ includeRequestedWith: false,
success: function(data) {
if (!data.hasOwnProperty('core_rewrite_test') || data.core_rewrite_test !== 'passed') {
failure();
ignoreError: false,
pinData: false,
silent: false,
+ includeRequestedWith: true,
// callbacks
failure: null,
}
if (this._options.url.indexOf(WSC_API_URL) === 0) {
- // allows allow credentials when querying the very own server
+ this._options.includeRequestedWith = true;
+ // always include credentials when querying the very own server
this._options.withCredentials = true;
}
if (this._options.contentType) {
this._xhr.setRequestHeader('Content-Type', this._options.contentType);
}
- this._xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+ if (this._options.withCredentials || this._options.includeRequestedWith) {
+ this._xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+ }
if (this._options.withCredentials) {
this._xhr.withCredentials = true;
}