http server: support announce at /

This commit is contained in:
Feross Aboukhadijeh 2014-06-05 23:40:37 -07:00
parent 85b7c606b9
commit 20d14391d5

View File

@ -585,7 +585,7 @@ Server.prototype._onHttpRequest = function (req, res) {
return error('bittorrent-tracker server only supports announcing one torrent at a time')
}
if (s[0] === '/announce') {
if (s[0] === '/announce' || s[0] === '/') {
var ip = self._trustProxy
? req.headers['x-forwarded-for'] || req.connection.remoteAddress
: req.connection.remoteAddress.replace(REMOVE_IPV6_RE, '') // force ipv4