Skip to content

Commit 65c44e8

Browse files
committed
http server: error on invalid peer_id
1 parent aceca28 commit 65c44e8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ Server.prototype._onHttpRequest = function (req, res) {
133133

134134
if (!infoHash) return error('invalid info_hash')
135135
if (infoHash.length !== 20) return error('invalid info_hash')
136+
if (!peerId) return error('invalid peer_id')
137+
if (peerId.length !== 20) return error('invalid peer_id')
136138
if (!port) return error('invalid port')
137139
if (!peerId) return error('invalid peer_id')
138140

0 commit comments

Comments
 (0)