Skip to content

Commit 725527a

Browse files
committed
add 'user-agent' in HTTP header
1 parent 524eb13 commit 725527a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/client/http-tracker.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,14 @@ HTTPTracker.prototype._request = function (requestUrl, params, cb) {
8989
var self = this
9090
var u = requestUrl + (requestUrl.indexOf('?') === -1 ? '?' : '&') +
9191
common.querystringStringify(params)
92+
var opts = {
93+
url: u,
94+
header: {
95+
'user-agent': self.client._userAgent || '',
96+
}
97+
}
9298

93-
get.concat(u, function (err, res, data) {
99+
get.concat(opts, function (err, res, data) {
94100
if (self.destroyed) return
95101
if (err) return self.client.emit('warning', err)
96102
if (res.statusCode !== 200) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bittorrent-tracker",
33
"description": "Simple, robust, BitTorrent tracker (client & server) implementation",
4-
"version": "8.0.12",
4+
"version": "8.0.13",
55
"author": {
66
"name": "Feross Aboukhadijeh",
77
"email": "[email protected]",

0 commit comments

Comments
 (0)