Permalink
Browse files

Write byte-length instead of string length, defaulting to UTF8

  • Loading branch information...
1 parent 6141bfa commit 4fe8c6de73ed7e27f25ef8f1553c9a791e5e9224 orls committed Jun 15, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/connect-jsonp.js
View
2 lib/connect-jsonp.js
@@ -95,7 +95,7 @@ module.exports = function jsonp(config) {
if (data) body += data;
body = context.callback + '(' + body + ')';
headers['Content-Type'] = APP_JS_CONTENT_TYPE;
- headers['Content-Length'] = body.length;
+ headers['Content-Length'] = Buffer.byteLength(body, encoding || "utf8");
previous(code, headers, res, context, body, encoding);
};

0 comments on commit 4fe8c6d

Please sign in to comment.