Skip to content

Commit ca57ea4

Browse files
authored
fix(api-req_end): req_end issue fix ZMS-147 (#681)
* Added submission api endpoint to api docs generation * req_end not included in graylog if value is false * fix req_end issue * cast value to string after first check
1 parent ebbbec8 commit ca57ea4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

api.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ const serverOptions = {
101101
};
102102

103103
Object.keys(req.params || {}).forEach(key => {
104-
let value = typeof req.params[key] === 'string' ? req.params[key] : util.inspect(req.params[key], false, 3).toString().trim();
104+
let value = req.params[key];
105105

106-
if (!value) {
106+
if (!value && value !== 0) {
107+
// if falsy don't continue, allow 0 integer as value
107108
return;
108109
}
109110

111+
// cast value to string
112+
value = util.inspect(req.params[key], false, 3).trim();
113+
110114
if (['password'].includes(key)) {
111115
value = '***';
112116
} else if (value.length > 128) {

0 commit comments

Comments
 (0)