Revert 8dc8773. Always send a HTTP/1.1 status line to the client.
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 5 Jul 2011 19:54:06 +0000 (21:54 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 7 Jul 2011 21:49:31 +0000 (23:49 +0200)
lib/http.js
test/simple/test-http-1.0.js

index 3b5c15f..af36d5f 100644 (file)
@@ -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)) {
index 3e06d01..58a6921 100644 (file)
@@ -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"