We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5bc1b50 commit 23d2c02Copy full SHA for 23d2c02
server.js
@@ -220,7 +220,13 @@ Server.prototype._onHttpRequest = function (req, res) {
220
} else if (s[0] === '/scrape') { // unofficial scrape message
221
if (typeof params.info_hash === 'string') {
222
params.info_hash = [ params.info_hash ]
223
+ } else if (params.info_hash == null) {
224
+ // if info_hash param is omitted, stats for all torrents are returned
225
+ params.info_hash = Object.keys(self.torrents).map(function (infoHashHex) {
226
+ return common.bytewiseEncodeURIComponent(new Buffer(infoHashHex, 'hex'))
227
+ })
228
}
229
+
230
if (!Array.isArray(params.info_hash)) return error('invalid info_hash')
231
232
var response = {
0 commit comments