Skip to content

Instantly share code, notes, and snippets.

@Sannis
Forked from kadirpekel/zerolengthbufferbug.js
Created September 29, 2010 19:45
Show Gist options
  • Save Sannis/603400 to your computer and use it in GitHub Desktop.
Save Sannis/603400 to your computer and use it in GitHub Desktop.
Zero length buffer bug
var http = require('http');
var Buffer = require('buffer').Buffer;
http.createServer(function (req, res) {
res.writeHead(200,
{'Content-Type': 'text/html',
'Content-Length': 0});
res.end(new Buffer(0), 'binary');
}
).listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment