From b62ecdc5bbee2a3bdfa8b62d43bb94326a9b5e4b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 5 Jul 2011 21:54:06 +0200 Subject: [PATCH] Revert 3e2a2a7. Always send a HTTP/1.1 status line to the client. --- lib/http.js | 7 ++----- test/simple/test-http-1.0.js | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/http.js b/lib/http.js index 1db953c..3bb24cb 100644 --- a/lib/http.js +++ b/lib/http.js @@ -771,8 +771,6 @@ function ServerResponse(req) { this.useChunkedEncodingByDefault = false; this.shouldKeepAlive = false; } - - this._httpVersion = req.httpVersion; } util.inherits(ServerResponse, OutgoingMessage); @@ -833,9 +831,8 @@ ServerResponse.prototype.writeHead = function(statusCode) { headers = obj; } - var statusLine = 'HTTP/' + this._httpVersion - + ' ' + statusCode.toString() - + ' ' + reasonPhrase + CRLF; + var statusLine = 'HTTP/1.1 ' + statusCode.toString() + ' ' + + reasonPhrase + CRLF; if (statusCode === 204 || statusCode === 304 || (100 <= statusCode && statusCode <= 199)) { diff --git a/test/simple/test-http-1.0.js b/test/simple/test-http-1.0.js index 3e06d01..58a6921 100644 --- a/test/simple/test-http-1.0.js +++ b/test/simple/test-http-1.0.js @@ -119,7 +119,7 @@ function test(handler, request_generator, response_validator) { } function response_validator(server_response, client_got_eof, timed_out) { - var expected_response = ("HTTP/1.0 200 OK\r\n" + var expected_response = ("HTTP/1.1 200 OK\r\n" + "Content-Type: text/plain\r\n" + "Connection: close\r\n" + "\r\n" -- 2.7.4