From a876a012641f8eba1a976eada15b6687d4a03f82 Mon Sep 17 00:00:00 2001 From: Jarrett Cruger Date: Mon, 15 Sep 2014 13:48:49 -0400 Subject: [PATCH] [minor] fixes for http transport --- lib/winston/transports/http.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/winston/transports/http.js b/lib/winston/transports/http.js index c887d8882..c6f7442a0 100644 --- a/lib/winston/transports/http.js +++ b/lib/winston/transports/http.js @@ -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); @@ -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); }