Merge pull request #64 from zckevin/master

[Client] Fix question mark in announceUrl
This commit is contained in:
Feross Aboukhadijeh 2015-03-09 20:17:43 -07:00
commit 54dfc6d7e9

View File

@ -274,7 +274,7 @@ Tracker.prototype._requestHttp = function (requestUrl, opts) {
} }
} }
get.concat(requestUrl + '?' + common.querystringStringify(opts), function (err, data, res) { get.concat(requestUrl + ((requestUrl.indexOf('?') !== -1) ? '&' : '?') + common.querystringStringify(opts), function (err, data, res) {
if (err) return self.client.emit('warning', err) if (err) return self.client.emit('warning', err)
if (res.statusCode !== 200) return self.client.emit('warning', new Error('Non-200 response code ' + res.statusCode + ' from ' + requestUrl)) if (res.statusCode !== 200) return self.client.emit('warning', new Error('Non-200 response code ' + res.statusCode + ' from ' + requestUrl))
if (data && data.length) self._handleResponse(requestUrl, data) if (data && data.length) self._handleResponse(requestUrl, data)