소스 검색

add Content-Length, fixes #238

jomo 5 년 전
부모
커밋
eae7745758
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      lib/response.js

+ 1 - 0
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,