Skip to content

Commit

Permalink
fix(api-req_end): req_end issue fix ZMS-147 (#681)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
NickOvt authored May 9, 2024
1 parent ebbbec8 commit ca57ea4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@ const serverOptions = {
};

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

if (!value) {
if (!value && value !== 0) {
// if falsy don't continue, allow 0 integer as value
return;
}

// cast value to string
value = util.inspect(req.params[key], false, 3).trim();

if (['password'].includes(key)) {
value = '***';
} else if (value.length > 128) {
Expand Down

0 comments on commit ca57ea4

Please sign in to comment.