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 f4df652 commit f7b73aaCopy full SHA for f7b73aa
lib/client/http-tracker.js
@@ -11,7 +11,7 @@ import Tracker from './tracker.js'
11
import compact2string from 'compact2string'
12
13
const debug = Debug('bittorrent-tracker:http-tracker')
14
-const HTTP_SCRAPE_SUPPORT = /\/(announce)[^/]*$/
+const HTTP_SCRAPE_SUPPORT = /(\/ann(?:ounce)?)[^/]*$/
15
16
/**
17
* HTTP torrent tracker client (for an individual tracker)
@@ -32,7 +32,7 @@ class HTTPTracker extends Tracker {
32
const match = this.announceUrl.match(HTTP_SCRAPE_SUPPORT)
33
if (match) {
34
const pre = this.announceUrl.slice(0, match.index)
35
- const post = this.announceUrl.slice(match.index + 9)
+ const post = this.announceUrl.slice(match.index + match[1].length)
36
this.scrapeUrl = `${pre}/scrape${post}`
37
}
38
0 commit comments