Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set user-agent header for http tracker requests #1019

Merged
merged 1 commit into from Jan 19, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Set user-agent header for http tracker requests

Fixes: #962
  • Loading branch information
feross committed Jan 18, 2017
commit 5d7fe98c6c1134bc057c27a57333dfd1a3964e6a
@@ -52,6 +52,7 @@ var FILESYSTEM_CONCURRENCY = 2
var RECONNECT_WAIT = [ 1000, 5000, 15000 ]

var VERSION = require('../package.json').version
var USER_AGENT = 'WebTorrent/' + VERSION + ' (https://webtorrent.io)'

var TMP
try {
@@ -332,7 +333,8 @@ Torrent.prototype._onListening = function () {
peerId: self.client.peerId,
dht: !self.private && self.client.dht,
tracker: trackerOpts,
port: self.client.torrentPort
port: self.client.torrentPort,
userAgent: USER_AGENT
})

self.discovery.on('error', onError)
@@ -395,7 +397,7 @@ Torrent.prototype._getMetadataFromServer = function () {
url: url,
method: 'GET',
headers: {
'user-agent': 'WebTorrent/' + VERSION + ' (https://webtorrent.io)'
'user-agent': USER_AGENT
}
}
var req
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.