From 14ef5dc4b0b69b7ef77b7927962e426f257b76c4 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 18 Mar 2016 22:49:13 -0700 Subject: [PATCH] ensure that `params.offers` is type Array --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index c4fd648..11c8acb 100644 --- a/server.js +++ b/server.js @@ -364,8 +364,8 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) { socket.send(JSON.stringify(response), socket.onSend) debug('sent response %s to %s', JSON.stringify(response), params.peer_id) - if (params.offers) { - debug('got offers %o from %s', params.offers, params.peer_id) + if (Array.isArray(params.offers)) { + debug('got %s offers from %s', params.offers.length, params.peer_id) debug('got %s peers from swarm %s', peers.length, params.info_hash) peers.forEach(function (peer, i) { peer.socket.send(JSON.stringify({