From eae774575852a98e627a855110af5b3fb860891a Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 29 Mar 2020 05:28:58 +0200 Subject: [PATCH] add Content-Length, fixes #238 --- lib/response.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/response.js b/lib/response.js index 19148ca..7f63d99 100644 --- a/lib/response.js +++ b/lib/response.js @@ -31,6 +31,7 @@ module.exports = function(request, response, result) { // These headers are the same for every response var headers = { "Content-Type": result.body && result.type || "text/plain", + "Content-Length": Buffer.from(result.body || "").length, "Cache-Control": "max-age=" + config.caching.browser, "Response-Time": Date.now() - request.start, "X-Request-ID": request.id,