Permalink
Browse files

Merge pull request #8 from orls/master

Fix some header issues
  • Loading branch information...
steelThread committed Jun 15, 2011
2 parents 3b63ca2 + 4fe8c6d commit b5046841022f32f863807d57fe37aff5d1654a9e
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/connect-jsonp.js
View
@@ -94,8 +94,8 @@ module.exports = function jsonp(config) {
res.end = function(data, encoding) {
if (data) body += data;
body = context.callback + '(' + body + ')';
- res.setHeader('Content-Type', APP_JS_CONTENT_TYPE);
- res.setHeader('Content-Length', body.length);
+ headers['Content-Type'] = APP_JS_CONTENT_TYPE;
+ headers['Content-Length'] = Buffer.byteLength(body, encoding || "utf8");
previous(code, headers, res, context, body, encoding);
};

0 comments on commit b504684

Please sign in to comment.