logging storage requests

This commit is contained in:
antelle 2020-03-22 20:58:29 +01:00
parent e9b05fe345
commit 5ac4b42452
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,7 @@ class StorageBase {
}
_xhr(config) {
this.logger.info('HTTP request', config.method || 'GET', config.url);
if (config.data) {
if (!config.dataType) {
config.dataType = 'application/octet-stream';
@ -58,6 +59,7 @@ class StorageBase {
};
}
this._httpRequest(config, response => {
this.logger.info('HTTP response', response.status);
const statuses = config.statuses || [200];
if (statuses.indexOf(response.status) >= 0) {
return config.success && config.success(response.response, response);