Browse Source

Revert 3e2a2a7. Always send a HTTP/1.1 status line to the client.

v0.7.4-release
Ben Noordhuis 13 years ago
parent
commit
b62ecdc5bb
  1. 7
      lib/http.js
  2. 2
      test/simple/test-http-1.0.js

7
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)) {

2
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"

Loading…
Cancel
Save