diff --git a/lib/parse_websocket.js b/lib/parse_websocket.js index d876b71..88de032 100644 --- a/lib/parse_websocket.js +++ b/lib/parse_websocket.js @@ -19,7 +19,7 @@ function parseWebSocketRequest (socket, params) { params.peer_id = common.binaryToHex(params.peer_id) if (params.answer) { - if (typeof params.to_peer_id !== 'string' || params.to_peer_id.length !== 20)) { + if (typeof params.to_peer_id !== 'string' || params.to_peer_id.length !== 20) { throw new Error('invalid `to_peer_id` (required with `answer`)') } params.to_peer_id = common.binaryToHex(params.to_peer_id)