bithavoc / express-winston

express.js middleware for winstonjs
https://www.npmjs.com/package/express-winston
MIT License
796 stars 187 forks source link

Log error when request body is null. #215

Open benmss opened 5 years ago

benmss commented 5 years ago

Hi,

The function returned by the logger function is throwing an error when trying to deal with a request object with a null body, due to trying to call Object.keys() on a null value. At lines 307:320 (v3.2.1): ... Object.keys(req.body) ...

Could the check at line 307: if ( req.body !== undefined ) { be adjusted to also check for a null body?

yinzara commented 4 years ago

I believe this was fixed with 4.0.0. Can you verify?