mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 20:21:36 +00:00
error on missing info hash
This commit is contained in:
parent
f21ab25347
commit
ac00794fb4
@ -116,10 +116,10 @@ Server.prototype._onHttpRequest = function (req, res) {
|
|||||||
|
|
||||||
// TODO: detect when required params are missing
|
// TODO: detect when required params are missing
|
||||||
// TODO: support multiple info_hash parameters as a concatenation of individual requests
|
// TODO: support multiple info_hash parameters as a concatenation of individual requests
|
||||||
var infoHash = bytewiseDecodeURIComponent(params.info_hash).toString('hex')
|
var infoHash = params.info_hash && bytewiseDecodeURIComponent(params.info_hash).toString('hex')
|
||||||
|
|
||||||
if (!infoHash) {
|
if (!infoHash) {
|
||||||
return error('bittorrent-tracker server only supports announcing one torrent at a time')
|
return error('missing info hash')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s[0] === '/announce' || s[0] === '/') {
|
if (s[0] === '/announce' || s[0] === '/') {
|
||||||
|
Loading…
Reference in New Issue
Block a user