Skip to content

Commit

Permalink
remove sensitive info from logs
Browse files Browse the repository at this point in the history
  • Loading branch information
paglias committed Jul 8, 2018
1 parent 18ed0fe commit 8a4c4e1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions website/server/middlewares/errorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ module.exports = function errorHandler (err, req, res, next) { // eslint-disable
logger.error(err, {
method: req.method,
originalUrl: req.originalUrl,
headers: omit(req.headers, ['x-api-key', 'cookie', 'password', 'confirmPassword']), // don't send sensitive information that only adds noise
body: req.body,

// don't send sensitive information that only adds noise
headers: omit(req.headers, ['x-api-key', 'cookie', 'password', 'confirmPassword']),
body: omit(req.body, ['password', 'confirmPassword']),

httpCode: responseErr.httpCode,
isHandledError: responseErr.httpCode < 500,
});
Expand Down

0 comments on commit 8a4c4e1

Please sign in to comment.