From d3814342ebc5b1a727cca94e74ed264736241556 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Fri, 27 Nov 2009 23:42:20 +0100 Subject: [PATCH] Fix for the previous too quick utf8-fix --- djangode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djangode.js b/djangode.js index 028c42c..3f61197 100644 --- a/djangode.js +++ b/djangode.js @@ -25,7 +25,7 @@ exports.serveFile = function(req, res, filename) { body = data; headers = [ ['Content-Type', content_type], - ['Content-Length', encodeURIComponent(body).replace(/%../g, 'x').length] + ['Content-Length', encoding === 'utf8' ? encodeURIComponent(body).replace(/%../g, 'x').length : body.length] ]; sys.puts("static file " + filename + " loaded"); callback();