Merge pull request #39 from overleaf/jpa-res-headers-public-api

[http] use public node api for getting the response content-length
This commit is contained in:
Brian Gough 2020-09-04 14:52:20 +01:00 committed by GitHub
commit b6b65b9638

View file

@ -39,7 +39,7 @@ module.exports.monitor = logger => (function(req, res, next) {
requestUrl: reqUrl,
requestSize,
status: res.statusCode,
responseSize: (res._headers != null ? res._headers["content-length"] : undefined),
responseSize: res.getHeader("content-length"),
userAgent: req.headers["user-agent"],
remoteIp,
referer: referrer,
@ -61,7 +61,7 @@ module.exports.monitor = logger => (function(req, res, next) {
"content-length": req.headers["content-length"]
},
res: {
"content-length": (res._headers != null ? res._headers["content-length"] : undefined),
"content-length": res.getHeader("content-length"),
statusCode: res.statusCode
},
"response-time": responseTimeMs