Skip to content

Commit

Permalink
[fix] Call res.resume() in HttpTransport to get around known issues…
Browse files Browse the repository at this point in the history
… in streams2.
  • Loading branch information
indexzero committed Nov 11, 2014
1 parent 514bd45 commit 1ba4f51
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/winston/transports/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,22 @@ Http.prototype._request = function (options, callback) {
req = (this.ssl ? https : http).request({
host: this.host,
port: this.port,
path: path.replace(/^\//, ''),
path: '/' + path.replace(/^\//, ''),
method: 'POST',
headers: { 'Content-Type': 'application/json' },
auth: (auth) ? auth.username + ':' + auth.password : ''
});

req.end(new Buffer(JSON.stringify(options), 'utf8'));

req.on('error', callback);
req.on('response', function (res) {
res.on('end', function () {
callback(null, res);
});

res.resume();
});

req.end(new Buffer(JSON.stringify(options), 'utf8'));
};

//
Expand Down

0 comments on commit 1ba4f51

Please sign in to comment.