From 6e1e9e2fcb8dd79eada404581c2cc3eb2cd245f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Geisendo=CC=88rfer?= Date: Tue, 22 Nov 2011 21:54:17 +0100 Subject: [PATCH] Get test-http-response-no-headers.js to pass Main fix was in 3abebf which added HTTP/0.9 support to http parser. Changed test because HTTP 1.1 mandates keep-alive when no headers are given. Fixes #1711 --- test/simple/test-http-response-no-headers.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/simple/test-http-response-no-headers.js b/test/simple/test-http-response-no-headers.js index aa5c37b7897..95bd01aed56 100644 --- a/test/simple/test-http-response-no-headers.js +++ b/test/simple/test-http-response-no-headers.js @@ -24,7 +24,11 @@ var assert = require('assert'); var http = require('http'); var net = require('net'); -var expected = 'I AM THE WALRUS'; +var expected = { + '0.9': 'I AM THE WALRUS', + '1.0': 'I AM THE WALRUS', + '1.1': '', +} var gotExpected = false; @@ -34,7 +38,7 @@ function test(httpVersion, callback) { }); var server = net.createServer(function(conn) { - var reply = 'HTTP/' + httpVersion + ' 200 OK\r\n\r\n' + expected; + var reply = 'HTTP/' + httpVersion + ' 200 OK\r\n\r\n' + expected[httpVersion]; conn.write(reply, function() { conn.destroy(); @@ -55,7 +59,7 @@ function test(httpVersion, callback) { }); res.on('end', function() { - assert.equal(body, expected); + assert.equal(body, expected[httpVersion]); gotExpected = true; server.close(); if (callback) process.nextTick(callback);