Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit d381434

Browse files
committed
Fix for the previous too quick utf8-fix
1 parent e856dae commit d381434

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

djangode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ exports.serveFile = function(req, res, filename) {
2525
body = data;
2626
headers = [
2727
['Content-Type', content_type],
28-
['Content-Length', encodeURIComponent(body).replace(/%../g, 'x').length]
28+
['Content-Length', encoding === 'utf8' ? encodeURIComponent(body).replace(/%../g, 'x').length : body.length]
2929
];
3030
sys.puts("static file " + filename + " loaded");
3131
callback();

0 commit comments

Comments
 (0)