mirror of https://github.com/keeweb/keeweb.git
logging storage requests
This commit is contained in:
parent
e9b05fe345
commit
5ac4b42452
|
@ -42,6 +42,7 @@ class StorageBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
_xhr(config) {
|
_xhr(config) {
|
||||||
|
this.logger.info('HTTP request', config.method || 'GET', config.url);
|
||||||
if (config.data) {
|
if (config.data) {
|
||||||
if (!config.dataType) {
|
if (!config.dataType) {
|
||||||
config.dataType = 'application/octet-stream';
|
config.dataType = 'application/octet-stream';
|
||||||
|
@ -58,6 +59,7 @@ class StorageBase {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
this._httpRequest(config, response => {
|
this._httpRequest(config, response => {
|
||||||
|
this.logger.info('HTTP response', response.status);
|
||||||
const statuses = config.statuses || [200];
|
const statuses = config.statuses || [200];
|
||||||
if (statuses.indexOf(response.status) >= 0) {
|
if (statuses.indexOf(response.status) >= 0) {
|
||||||
return config.success && config.success(response.response, response);
|
return config.success && config.success(response.response, response);
|
||||||
|
|
Loading…
Reference in New Issue