Merge branch 'master' of github.com:koajs/koa

master
TJ Holowaychuk 2013-09-02 18:29:04 -07:00
commit f6161918ee
1 changed files with 1 additions and 1 deletions

View File

@ -212,7 +212,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);