Added json accept header on resouces fetch
This commit is contained in:
parent
efff34774e
commit
7a2f9bf7ad
|
@ -216,10 +216,11 @@ Add unit tests for any new or changed functionality. Lint and test your code.
|
|||
|
||||
### 0.2.0
|
||||
* Moved error.style and question.style to css file.
|
||||
* Change dist with extra css/js folder.
|
||||
* Changed dist with extra css/js folder.
|
||||
* Added loader progress bar.
|
||||
* refined css so question/loader/error are equal.
|
||||
* Added response header check support.
|
||||
* Added json accept header on assets resources list.
|
||||
|
||||
### 0.1.1
|
||||
* Moved websql delete timeout to cleanServerlUrl for faster boot.
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/**
|
||||
* FFSpaLoader is an assets loader for single page applications.
|
||||
* Its build around the concept the there is only a single static index.html which
|
||||
* synces all its assets to local cache for offline and or fast page loads.
|
||||
* synces all its assets to local cache for offline use and or fast page loads.
|
||||
*
|
||||
* @module FFSpaLoader
|
||||
*/
|
||||
|
@ -330,7 +330,7 @@
|
|||
* @param {function} cb Error first callback when done.
|
||||
* @private
|
||||
*/
|
||||
var utilHttpFetch = function (url, cb) {
|
||||
var utilHttpFetch = function (url, cb, onlyJson) {
|
||||
var startTime = new Date().getTime();
|
||||
var httpRequest = new XMLHttpRequest();
|
||||
httpRequest.onreadystatechange = function() {
|
||||
|
@ -369,6 +369,9 @@
|
|||
var headerValue = options.server.header.request[headerKey];
|
||||
httpRequest.setRequestHeader(headerKey,headerValue);
|
||||
}
|
||||
if (onlyJson === true) {
|
||||
httpRequest.setRequestHeader('Accept','application/json');
|
||||
}
|
||||
httpRequest.send();
|
||||
};
|
||||
|
||||
|
@ -783,7 +786,7 @@
|
|||
progressBar.done();
|
||||
});
|
||||
}
|
||||
});
|
||||
}, true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -857,7 +860,7 @@
|
|||
} else {
|
||||
startLoader(clearUi);
|
||||
}
|
||||
});
|
||||
}, true);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue