Skip to content

Commit b62ecdc

Browse files
committed
Revert 3e2a2a7. Always send a HTTP/1.1 status line to the client.
1 parent 073fbea commit b62ecdc

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

lib/http.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,6 @@ function ServerResponse(req) {
771771
this.useChunkedEncodingByDefault = false;
772772
this.shouldKeepAlive = false;
773773
}
774-
775-
this._httpVersion = req.httpVersion;
776774
}
777775
util.inherits(ServerResponse, OutgoingMessage);
778776

@@ -833,9 +831,8 @@ ServerResponse.prototype.writeHead = function(statusCode) {
833831
headers = obj;
834832
}
835833

836-
var statusLine = 'HTTP/' + this._httpVersion
837-
+ ' ' + statusCode.toString()
838-
+ ' ' + reasonPhrase + CRLF;
834+
var statusLine = 'HTTP/1.1 ' + statusCode.toString() + ' ' +
835+
reasonPhrase + CRLF;
839836

840837
if (statusCode === 204 || statusCode === 304 ||
841838
(100 <= statusCode && statusCode <= 199)) {

test/simple/test-http-1.0.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function test(handler, request_generator, response_validator) {
119119
}
120120

121121
function response_validator(server_response, client_got_eof, timed_out) {
122-
var expected_response = ("HTTP/1.0 200 OK\r\n"
122+
var expected_response = ("HTTP/1.1 200 OK\r\n"
123123
+ "Content-Type: text/plain\r\n"
124124
+ "Connection: close\r\n"
125125
+ "\r\n"

0 commit comments

Comments
 (0)