This commit is contained in:
Andris Reinman 2018-10-18 10:57:41 +03:00
parent 2c88242b30
commit 8a52635171

15
api.js
View file

@ -74,30 +74,35 @@ const serverOptions = {
if (!value) { if (!value) {
return; return;
} }
if (['password'].includes(key)) { if (['password'].includes(key)) {
value = '***'; value = '***';
} else if (value.length > 64) { } else if (value.length > 64) {
value = value.substr(0, 63) + '…'; value = value.substr(0, 63) + '…';
} }
if (key.length > 30) { if (key.length > 30) {
key = key.substr(0, 30) + '…'; key = key.substr(0, 30) + '…';
} }
message['_req_' + key] = value; message['_req_' + key] = value;
}); });
Object.keys(body).forEach(key => { Object.keys(body).forEach(key => {
let value = (body[key] || '').toString().trim(); let value = body[key];
if (!value || ['success', 'error', 'code']) { if (!body || !['id'].includes(key)) {
return; return;
} }
if (['secretKey'].includes(key)) { value = (value || '').toString().trim();
value = '***';
} else if (value.length > 64) { if (value.length > 64) {
value = value.substr(0, 63) + '…'; value = value.substr(0, 63) + '…';
} }
if (key.length > 30) { if (key.length > 30) {
key = key.substr(0, 30) + '…'; key = key.substr(0, 30) + '…';
} }
message['_res_' + key] = value; message['_res_' + key] = value;
}); });