Skip to content

Instantly share code, notes, and snippets.

@DracoBlue
Created May 9, 2010 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DracoBlue/395385 to your computer and use it in GitHub Desktop.
Save DracoBlue/395385 to your computer and use it in GitHub Desktop.
res.writeHead(200, {
"Content-Type": mime_type,
"Cache-Control": "public, max-age=300",
'Content-Length': content.length
});
// a) works in 0.1.94:
var content_length = content.length;
var i = 0;
while (i<content_length) {
res.write(content.substr(i,1024), "binary");
i = i + 1024;
}
// b) does not work in 0.1.94 (only first 32kb are sent)
// res.write(content, "binary");
res.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment