Skip to content

Commit

Permalink
Content-Length doesn't count characters, but bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
svick committed Aug 6, 2010
1 parent 304c0a5 commit fe4824e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/node-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ exports.getServer = function getServer(logger) {
function simpleResponse(code, body, content_type, extra_headers) {
res.writeHead(code, (extra_headers || []).concat(
[ ["Content-Type", content_type],
["Content-Length", body.length]
["Content-Length", Buffer.byteLength(body, 'utf8')]
]));
res.write(body);
res.write(body, 'utf8');
res.end();
}

Expand Down

0 comments on commit fe4824e

Please sign in to comment.