1
// Serving up a zero-length buffer should work.
3
var common = require("../common");
4
var assert = common.assert;
5
var http = require('http');
7
var server = http.createServer(function (req, res) {
8
var buffer = new Buffer(0);
9
res.writeHead(200, {'Content-Type': 'text/html',
10
'Content-Length': buffer.length});
14
var gotResponse = false;
17
server.listen(common.PORT, function () {
18
var client = http.createClient(common.PORT);
20
var req = client.request('GET', '/');
23
req.on('response', function (res) {
26
res.on('data', function (d) {
27
resBodySize += d.length;
30
res.on('end', function (d) {
36
process.on('exit', function () {
37
assert.ok(gotResponse);
38
assert.equal(0, resBodySize);