From 520df772ef0eae861c36e1a55905f23c8a407846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20B=C3=B6hlmark?= Date: Mon, 2 Sep 2013 23:55:38 +0200 Subject: [PATCH] use byteLength when calculating content-length --- lib/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index e7c5a26..c787793 100644 --- a/lib/application.js +++ b/lib/application.js @@ -209,7 +209,7 @@ function respond(next){ // body: json body = JSON.stringify(body, null, this.app.jsonSpaces); - this.set('Content-Length', body.length); + this.set('Content-Length', Buffer.byteLength(body)); this.set('Content-Type', 'application/json'); if (head) return res.end(); res.end(body);