Skip to content

Commit

Permalink
[minor] fixes for http transport
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrugzz committed Sep 15, 2014
1 parent 4f08838 commit a876a01
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/winston/transports/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@ Http.prototype._request = function (options, callback) {
path: path.replace(/^\//, ''),
method: 'POST',
headers: { 'Content-Type': 'application/json' },
auth: (auth) ? auth.username + ':' + this.auth.password : ''
auth: (auth) ? auth.username + ':' + auth.password : ''
});

req.write(JSON.stringify(options));

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

req.on('error', callback);

Expand Down Expand Up @@ -108,7 +106,7 @@ Http.prototype.log = function (level, msg, meta, callback) {
}
}

this._request(options, function (err, res, body) {
this._request(options, function (err, res) {
if (res && res.statusCode !== 200) {
err = new Error('HTTP Status Code: ' + res.statusCode);
}
Expand Down

0 comments on commit a876a01

Please sign in to comment.