mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 20:21:36 +00:00
add 'user-agent' in HTTP header
This commit is contained in:
parent
e0ede27049
commit
bd8bc9f6af
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user