add 'user-agent' in HTTP header

This commit is contained in:
ZunSThy 2016-10-29 02:51:37 +08:00
parent 524eb13b09
commit 725527aa84
2 changed files with 8 additions and 2 deletions

View File

@ -89,8 +89,14 @@ HTTPTracker.prototype._request = function (requestUrl, params, cb) {
var self = this
var u = requestUrl + (requestUrl.indexOf('?') === -1 ? '?' : '&') +
common.querystringStringify(params)
var opts = {
url: u,
header: {
'user-agent': self.client._userAgent || '',
}
}
get.concat(u, function (err, res, data) {
get.concat(opts, function (err, res, data) {
if (self.destroyed) return
if (err) return self.client.emit('warning', err)
if (res.statusCode !== 200) {

View File

@ -1,7 +1,7 @@
{
"name": "bittorrent-tracker",
"description": "Simple, robust, BitTorrent tracker (client & server) implementation",
"version": "8.0.12",
"version": "8.0.13",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",