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

Commit

Permalink
Fix the content length for UTF8 content. Used trick found at http://d…
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Nov 27, 2009
1 parent e36cd12 commit e856dae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion djangode.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports.serveFile = function(req, res, filename) {
body = data;
headers = [
['Content-Type', content_type],
['Content-Length', body.length]
['Content-Length', encodeURIComponent(body).replace(/%../g, 'x').length]
];
sys.puts("static file " + filename + " loaded");
callback();
Expand Down

0 comments on commit e856dae

Please sign in to comment.