summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2011-06-29 20:24:16 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2011-07-05 01:13:57 +0200
commit8dc87731c76f8a4a86d62b3fb6d5641d084e528c (patch)
treed32bd08e6fdaaf737f1d9a3c4a47ce6e9eb1886f /lib
parent092fc42fbf53b5884a44cdc39091603e9863431a (diff)
downloadandroid-node-v8-8dc87731c76f8a4a86d62b3fb6d5641d084e528c.tar.gz
android-node-v8-8dc87731c76f8a4a86d62b3fb6d5641d084e528c.tar.bz2
android-node-v8-8dc87731c76f8a4a86d62b3fb6d5641d084e528c.zip
Don't send a HTTP/1.1 status line to HTTP/1.0 clients.
Fixes #1234.
Diffstat (limited to 'lib')
-rw-r--r--lib/http.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/http.js b/lib/http.js
index ce8193f905..5dc62745ce 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -771,6 +771,8 @@ function ServerResponse(req) {
this.useChunkedEncodingByDefault = false;
this.shouldKeepAlive = false;
}
+
+ this._httpVersion = req.httpVersion;
}
util.inherits(ServerResponse, OutgoingMessage);
@@ -831,8 +833,9 @@ ServerResponse.prototype.writeHead = function(statusCode) {
headers = obj;
}
- var statusLine = 'HTTP/1.1 ' + statusCode.toString() + ' ' +
- reasonPhrase + CRLF;
+ var statusLine = 'HTTP/' + this._httpVersion
+ + ' ' + statusCode.toString()
+ + ' ' + reasonPhrase + CRLF;
if (statusCode === 204 || statusCode === 304 ||
(100 <= statusCode && statusCode <= 199)) {