mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 19:06:27 +00:00
ensure that params.offers
is type Array
This commit is contained in:
parent
efb81c29cc
commit
14ef5dc4b0
@ -364,8 +364,8 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) {
|
|||||||
socket.send(JSON.stringify(response), socket.onSend)
|
socket.send(JSON.stringify(response), socket.onSend)
|
||||||
debug('sent response %s to %s', JSON.stringify(response), params.peer_id)
|
debug('sent response %s to %s', JSON.stringify(response), params.peer_id)
|
||||||
|
|
||||||
if (params.offers) {
|
if (Array.isArray(params.offers)) {
|
||||||
debug('got offers %o from %s', params.offers, params.peer_id)
|
debug('got %s offers from %s', params.offers.length, params.peer_id)
|
||||||
debug('got %s peers from swarm %s', peers.length, params.info_hash)
|
debug('got %s peers from swarm %s', peers.length, params.info_hash)
|
||||||
peers.forEach(function (peer, i) {
|
peers.forEach(function (peer, i) {
|
||||||
peer.socket.send(JSON.stringify({
|
peer.socket.send(JSON.stringify({
|
||||||
|
Loading…
Reference in New Issue
Block a user