Skip to content

Commit

Permalink
fix(api-graylog-req): Do not use util.inspect if value already string…
Browse files Browse the repository at this point in the history
… ZMS-174 (#736)

* Added submission api endpoint to api docs generation

* api.js, fix util inspect, no need to inspect string value
  • Loading branch information
NickOvt authored Sep 26, 2024
1 parent ee870b9 commit 1a12b03
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ const serverOptions = {
return;
}

// cast value to string
value = util.inspect(req.params[key], false, 3).trim();
// cast value to string if not string
value = typeof req.params[key] === 'string' ? req.params[key] : util.inspect(req.params[key], false, 3).toString().trim();

if (['password'].includes(key)) {
value = '***';
Expand Down Expand Up @@ -620,7 +620,6 @@ module.exports = done => {
}
started = true;
log.info('API', 'Server listening on %s:%s', config.api.host || '0.0.0.0', config.api.port);

done(null, server);
});
};

0 comments on commit 1a12b03

Please sign in to comment.