Skip to content

Commit 14ef5dc

Browse files
committed
ensure that params.offers is type Array
1 parent efb81c2 commit 14ef5dc

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
@@ -364,8 +364,8 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) {
364364
socket.send(JSON.stringify(response), socket.onSend)
365365
debug('sent response %s to %s', JSON.stringify(response), params.peer_id)
366366

367-
if (params.offers) {
368-
debug('got offers %o from %s', params.offers, params.peer_id)
367+
if (Array.isArray(params.offers)) {
368+
debug('got %s offers from %s', params.offers.length, params.peer_id)
369369
debug('got %s peers from swarm %s', peers.length, params.info_hash)
370370
peers.forEach(function (peer, i) {
371371
peer.socket.send(JSON.stringify({

0 commit comments

Comments
 (0)