Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Content-Length doesn't count characters, but bytes

  • Loading branch information...
commit fe4824ee441a5f6b78ec992cd47401c9f13cf07b 1 parent 304c0a5
@svick svick authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/node-router.js
View
4 lib/node-router.js
@@ -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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.