express-winston icon indicating copy to clipboard operation
express-winston copied to clipboard

Log error when request body is null.

Open benmss opened this issue 6 years ago • 1 comments

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?

benmss avatar Jul 19 '19 04:07 benmss

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

yinzara avatar Mar 01 '20 18:03 yinzara