Skip to content

Commit c38cdd9

Browse files
committed
i'm getting tired
1 parent 2cf4bf6 commit c38cdd9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ Server.prototype._onRequest = function (req, res) {
352352
var port = Number(params.port)
353353
var addr = ip + ':' + port
354354

355-
var infoHash = bytewiseDecodeURIComponent(params.info_hash)
356-
var peerId = bytewiseDecodeURIComponent(params.peer_id)
355+
var infoHash = bytewiseDecodeURIComponent(params.info_hash).toString('hex')
356+
var peerId = bytewiseDecodeURIComponent(params.peer_id).toString('utf8')
357357

358358
var swarm = self.torrents[infoHash]
359359
if (!swarm) {
@@ -494,5 +494,5 @@ function bytewiseEncodeURIComponent (buf) {
494494
}
495495

496496
function bytewiseDecodeURIComponent (str) {
497-
return (new Buffer(decodeURIComponent(str), 'binary').toString('hex'))
497+
return new Buffer(decodeURIComponent(str), 'binary')
498498
}

0 commit comments

Comments
 (0)