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);