Skip to content

Commit

Permalink
Merge pull request #679 from MarcosLopezC/hotfix/middleware-setup-log
Browse files Browse the repository at this point in the history
Fix log bug when running server
  • Loading branch information
sintaxi authored Jan 13, 2023
2 parents 4881027 + 3bd0724 commit b55a5b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports.setupLog = function(req, rsp, next){
try{
contentLength = parseInt(rsp._header.split("\n").find(h => h.includes("Content-Length")).split(" ")[1].split("\r")[0])
}catch(e){}
console.log(new Date(), rsp.req.method.green, rsp.statusCode, rsp.req.url, measureBody(contentLength).grey)
console.log(new Date(), req.method.green, rsp.statusCode, req.url, measureBody(contentLength).grey)
})

// var start = process.hrtime()
Expand Down

0 comments on commit b55a5b5

Please sign in to comment.