Skip to content

Commit 91cb2d3

Browse files
authored
Merge pull request webtorrent#179 from zunsthy/feature-add-user-agent
add 'user-agent' in HTTP header
2 parents 563c55b + bd8bc9f commit 91cb2d3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
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) {

0 commit comments

Comments
 (0)