From c38cdd94e1157aa0d1ecb4eb0fe078c22d6b3948 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 11 Apr 2014 22:00:03 -0700 Subject: [PATCH] i'm getting tired --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index c98cf52..91ebb05 100644 --- a/index.js +++ b/index.js @@ -352,8 +352,8 @@ Server.prototype._onRequest = function (req, res) { var port = Number(params.port) var addr = ip + ':' + port - var infoHash = bytewiseDecodeURIComponent(params.info_hash) - var peerId = bytewiseDecodeURIComponent(params.peer_id) + var infoHash = bytewiseDecodeURIComponent(params.info_hash).toString('hex') + var peerId = bytewiseDecodeURIComponent(params.peer_id).toString('utf8') var swarm = self.torrents[infoHash] if (!swarm) { @@ -494,5 +494,5 @@ function bytewiseEncodeURIComponent (buf) { } function bytewiseDecodeURIComponent (str) { - return (new Buffer(decodeURIComponent(str), 'binary').toString('hex')) + return new Buffer(decodeURIComponent(str), 'binary') }