Revert 3e2a2a7. Always send a HTTP/1.1 status line to the client.
This commit is contained in:
parent
073fbea0f5
commit
b62ecdc5bb
@ -771,8 +771,6 @@ function ServerResponse(req) {
|
|||||||
this.useChunkedEncodingByDefault = false;
|
this.useChunkedEncodingByDefault = false;
|
||||||
this.shouldKeepAlive = false;
|
this.shouldKeepAlive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._httpVersion = req.httpVersion;
|
|
||||||
}
|
}
|
||||||
util.inherits(ServerResponse, OutgoingMessage);
|
util.inherits(ServerResponse, OutgoingMessage);
|
||||||
|
|
||||||
@ -833,9 +831,8 @@ ServerResponse.prototype.writeHead = function(statusCode) {
|
|||||||
headers = obj;
|
headers = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
var statusLine = 'HTTP/' + this._httpVersion
|
var statusLine = 'HTTP/1.1 ' + statusCode.toString() + ' ' +
|
||||||
+ ' ' + statusCode.toString()
|
reasonPhrase + CRLF;
|
||||||
+ ' ' + reasonPhrase + CRLF;
|
|
||||||
|
|
||||||
if (statusCode === 204 || statusCode === 304 ||
|
if (statusCode === 204 || statusCode === 304 ||
|
||||||
(100 <= statusCode && statusCode <= 199)) {
|
(100 <= statusCode && statusCode <= 199)) {
|
||||||
|
@ -119,7 +119,7 @@ function test(handler, request_generator, response_validator) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function response_validator(server_response, client_got_eof, timed_out) {
|
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"
|
+ "Content-Type: text/plain\r\n"
|
||||||
+ "Connection: close\r\n"
|
+ "Connection: close\r\n"
|
||||||
+ "\r\n"
|
+ "\r\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user