This commit is contained in:
Feross Aboukhadijeh 2015-04-01 17:36:33 +13:00
parent 7e7062d2ae
commit 97222ed16d

View File

@ -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)