Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-07-22 14:10:38 +0400
committerRyan Dahl <ry@tinyclouds.org>2011-07-22 14:10:38 +0400
commit0ed1354119487f164887989715c9a43ac22a65f6 (patch)
treeacedfe3e85380e5aa254160d5719d490c31a8ecc /lib
parentdaead5f5bb6dc9ce4fc5fd984bd48deecffe1dae (diff)
parenteffc4469d00f53c0ce4057d385a968093db3d645 (diff)
Merge branch 'v0.4'
Conflicts: ChangeLog deps/v8/src/version.cc doc/index.html src/node_version.h test/simple/test-url.js wscript
Diffstat (limited to 'lib')
-rw-r--r--lib/http.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/http.js b/lib/http.js
index a0297142c5a..e7e28e816c4 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -652,6 +652,12 @@ OutgoingMessage.prototype.end = function(data, encoding) {
this._implicitHeader();
}
+ if (data && !this._hasBody) {
+ console.error('This type of response MUST NOT have a body. ' +
+ 'Ignoring data passed to end().');
+ data = false;
+ }
+
var ret;
var hot = this._headerSent === false &&
@@ -667,6 +673,7 @@ OutgoingMessage.prototype.end = function(data, encoding) {
// res.writeHead();
// res.end(blah);
// HACKY.
+
if (this.chunkedEncoding) {
var l = Buffer.byteLength(data, encoding).toString(16);
ret = this.connection.write(this._header + l + CRLF +