diff options
author | isaacs <i@izs.me> | 2012-10-12 02:53:11 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-10-12 03:46:18 +0400 |
commit | 061f2075cf81017cdb40de80533ba18746743c94 (patch) | |
tree | 35f6b2608572336927f93c1fb7c36298e22ebf0f /lib/http.js | |
parent | d7c45ea7d03de5c4a6c71b34780150fcd1e6314c (diff) |
string_decoder: Add 'end' method, do base64 properly
Diffstat (limited to 'lib/http.js')
-rw-r--r-- | lib/http.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/http.js b/lib/http.js index 4aa8f5cb40f..3c8b60944c5 100644 --- a/lib/http.js +++ b/lib/http.js @@ -363,6 +363,11 @@ IncomingMessage.prototype._emitData = function(d) { IncomingMessage.prototype._emitEnd = function() { if (!this._endEmitted) { + if (this._decoder) { + var ret = this._decoder.end(); + if (ret) + this.emit('data', ret); + } this.emit('end'); } @@ -1859,6 +1864,11 @@ Client.prototype.request = function(method, path, headers) { // but it will get removed when we remove this legacy interface. c.on('socket', function(s) { s.on('end', function() { + if (self._decoder) { + var ret = self._decoder.end(); + if (ret) + self.emit('data', ret); + } self.emit('end'); }); }); |