Skip to content

Instantly share code, notes, and snippets.

@kadirpekel
Created September 29, 2010 19:41
Show Gist options
  • Save kadirpekel/603394 to your computer and use it in GitHub Desktop.
Save kadirpekel/603394 to your computer and use it in GitHub Desktop.
var http = require('http');
var Buffer = require('buffer').Buffer;
http.createServer(function (req, res) {
var buffer = new Buffer(0);
res.writeHead(200,
{'Content-Type': 'text/html',
'Content-Length': buffer.length});
res.end(buffer, 'binary');
}
).listen(3000);
@kadirpekel
Copy link
Author

Buffer with zero length with 'Content-Length' header set to buffer length zero causes server hang on responding.
This is an expected behaviour or bug? Any idea?

@kadirpekel
Copy link
Author

@kadirpekel
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment