Skip to content

Commit ac00794

Browse files
committed
error on missing info hash
1 parent f21ab25 commit ac00794

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
@@ -116,10 +116,10 @@ Server.prototype._onHttpRequest = function (req, res) {
116116

117117
// TODO: detect when required params are missing
118118
// TODO: support multiple info_hash parameters as a concatenation of individual requests
119-
var infoHash = bytewiseDecodeURIComponent(params.info_hash).toString('hex')
119+
var infoHash = params.info_hash && bytewiseDecodeURIComponent(params.info_hash).toString('hex')
120120

121121
if (!infoHash) {
122-
return error('bittorrent-tracker server only supports announcing one torrent at a time')
122+
return error('missing info hash')
123123
}
124124

125125
if (s[0] === '/announce' || s[0] === '/') {

0 commit comments

Comments
 (0)