Skip to content

Commit 340b3fa

Browse files
committed
server: always send binary ids
1 parent 749cee1 commit 340b3fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Server.prototype._onWebSocketRequest = function (socket, params) {
275275
} catch (err) {
276276
socket.send(JSON.stringify({
277277
'failure reason': err.message,
278-
info_hash: params.info_hash
278+
info_hash: common.hexToBinary(params.info_hash)
279279
}), socket.onSend)
280280

281281
// even though it's an error for the client, it's just a warning for the server.
@@ -302,7 +302,7 @@ Server.prototype._onWebSocketRequest = function (socket, params) {
302302
var peers = response.peers
303303
delete response.peers
304304
response.interval = self._intervalMs
305-
response.info_hash = params.info_hash // as hex
305+
response.info_hash = common.hexToBinary(params.info_hash)
306306

307307
socket.send(JSON.stringify(response), socket.onSend)
308308
debug('sent response %s to %s', JSON.stringify(response), params.peer_id)

0 commit comments

Comments
 (0)