From ebfc90b5059664f370f5f7e7dbfcdd6e827d3cbd Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 18 Feb 2011 11:30:52 -0800 Subject: [PATCH] Remove test-http-eof-before-eom - wasn't testing anything important --- test/simple/test-http-eof-before-eom.js | 72 ------------------------- 1 file changed, 72 deletions(-) delete mode 100644 test/simple/test-http-eof-before-eom.js diff --git a/test/simple/test-http-eof-before-eom.js b/test/simple/test-http-eof-before-eom.js deleted file mode 100644 index d67881f5af..0000000000 --- a/test/simple/test-http-eof-before-eom.js +++ /dev/null @@ -1,72 +0,0 @@ -// I hate HTTP. One way of terminating an HTTP response is to not send -// a content-length header, not send a transfer-encoding: chunked header, -// and simply terminate the TCP connection. That is identity -// transfer-encoding. -// -// This test is to be sure that the https client is handling this case -// correctly. -if (!process.versions.openssl) { - console.error('Skipping because node compiled without OpenSSL.'); - process.exit(0); -} - -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); -var http = require('http'); -var fs = require('fs'); - - -var server = net.Server(function(socket) { - console.log('2) Server got request'); - socket.write('HTTP/1.1 200 OK\r\n' + - 'Content-Length: 200\r\n'); - - // note headers are incomplete. - - setTimeout(function() { - socket.end('Server: gws\r\n'); - console.log('4) Server finished response'); - }, 100); -}); - - -var gotHeaders = false; -var gotEnd = false; -var bodyBuffer = ''; - -server.listen(common.PORT, function() { - console.log('1) Making Request'); - var req = http.get({ port: common.PORT }, function(res) { - server.close(); - console.log('3) Client got response headers.'); - - assert.equal('gws', res.headers.server); - gotHeaders = true; - - res.setEncoding('utf8'); - res.on('data', function(s) { - bodyBuffer += s; - }); - - res.on('aborted', function() { - console.log('RESPONSE ABORTED'); - }); - - req.connection.on('error', function() { - console.log('INCOMOLETE'); - }); - - res.on('end', function() { - console.log('5) Client got "end" event.'); - gotEnd = true; - }); - }); -}); - -process.on('exit', function() { - assert.ok(gotHeaders); - assert.ok(gotEnd); - assert.equal('hello\nworld\n', bodyBuffer); -}); -