Merge pull request #46 from karlbohlmark/json-response-length
use byteLength when calculating content-length
This commit is contained in:
commit
fab0150a63
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue