{"action":"created","issue":{"url":"https://api.github.com/repos/bithavoc/express-winston/issues/62","repository_url":"https://api.github.com/repos/bithavoc/express-winston","labels_url":"https://api.github.com/repos/bithavoc/express-winston/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/bithavoc/express-winston/issues/62/comments","events_url":"https://api.github.com/repos/bithavoc/express-winston/issues/62/events","html_url":"https://github.com/bithavoc/express-winston/issues/62","id":56983856,"number":62,"title":"Filter authorization header by default","user":{"login":"gingermusketeer","id":1177034,"avatar_url":"https://avatars.githubusercontent.com/u/1177034?v=3","gravatar_id":"","url":"https://api.github.com/users/gingermusketeer","html_url":"https://github.com/gingermusketeer","followers_url":"https://api.github.com/users/gingermusketeer/followers","following_url":"https://api.github.com/users/gingermusketeer/following{/other_user}","gists_url":"https://api.github.com/users/gingermusketeer/gists{/gist_id}","starred_url":"https://api.github.com/users/gingermusketeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gingermusketeer/subscriptions","organizations_url":"https://api.github.com/users/gingermusketeer/orgs","repos_url":"https://api.github.com/users/gingermusketeer/repos","events_url":"https://api.github.com/users/gingermusketeer/events{/privacy}","received_events_url":"https://api.github.com/users/gingermusketeer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bithavoc/express-winston/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-09T03:09:19Z","updated_at":"2016-03-09T19:17:09Z","closed_at":null,"body":"Currently it is not straight forward to filter the authorization header. It would be nice if there was a flag or an easy way to do this.\r\n\r\nPerhaps this should be on by default.\r\n\r\nHere is what i am currently doing\r\n\r\n```js\r\nfunction customRequestFilter(req, propName){\r\n  if(propName === \"headers\"){\r\n    return Object.keys(req.headers).reduce(function(filteredHeaders, key){\r\n      if(key !== \"authorization\"){\r\n        filteredHeaders[key] = req.headers[key]\r\n      }\r\n      return filteredHeaders\r\n    }, {})\r\n  } else {\r\n    return req[propName]\r\n  }\r\n}\r\n\r\nmodule.exports = expressWinston.logger({\r\n    transports: transports,\r\n    requestFilter: customRequestFilter\r\n })\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/bithavoc/express-winston/issues/comments/194461161","html_url":"https://github.com/bithavoc/express-winston/issues/62#issuecomment-194461161","issue_url":"https://api.github.com/repos/bithavoc/express-winston/issues/62","id":194461161,"user":{"login":"adamhadani","id":139888,"avatar_url":"https://avatars.githubusercontent.com/u/139888?v=3","gravatar_id":"","url":"https://api.github.com/users/adamhadani","html_url":"https://github.com/adamhadani","followers_url":"https://api.github.com/users/adamhadani/followers","following_url":"https://api.github.com/users/adamhadani/following{/other_user}","gists_url":"https://api.github.com/users/adamhadani/gists{/gist_id}","starred_url":"https://api.github.com/users/adamhadani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamhadani/subscriptions","organizations_url":"https://api.github.com/users/adamhadani/orgs","repos_url":"https://api.github.com/users/adamhadani/repos","events_url":"https://api.github.com/users/adamhadani/events{/privacy}","received_events_url":"https://api.github.com/users/adamhadani/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T19:17:09Z","updated_at":"2016-03-09T19:17:09Z","body":"very helpful guys, thanks! "}}