Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.js2
-rw-r--r--test/basic-node.js2
-rw-r--r--test/blocklist.js6
3 files changed, 5 insertions, 5 deletions
diff --git a/index.js b/index.js
index ad96320..3a404b2 100644
--- a/index.js
+++ b/index.js
@@ -75,7 +75,7 @@ function WebTorrent (opts) {
if (typeof loadIPSet === 'function') {
loadIPSet(opts.blocklist, {
- headers: { 'user-agent': 'WebTorrent (http://webtorrent.io)' }
+ headers: { 'user-agent': 'WebTorrent/' + VERSION + ' (http://webtorrent.io)' }
}, function (err, ipSet) {
if (err) return self.error('Failed to load blocklist: ' + err.message)
self.blocked = ipSet
diff --git a/test/basic-node.js b/test/basic-node.js
index cfdc70f..494dace 100644
--- a/test/basic-node.js
+++ b/test/basic-node.js
@@ -16,7 +16,7 @@ test('client.add: http url to a torrent file, string', function (t) {
t.plan(3)
var server = http.createServer(function (req, res) {
- t.equal(req.headers['user-agent'], 'WebTorrent (http://webtorrent.io)')
+ t.ok(req.headers['user-agent'].indexOf('WebTorrent') !== -1)
res.end(leaves)
})
diff --git a/test/blocklist.js b/test/blocklist.js
index dd35fa0..6c64618 100644
--- a/test/blocklist.js
+++ b/test/blocklist.js
@@ -137,7 +137,7 @@ test('blocklist (http url)', function (t) {
t.plan(49)
var server = http.createServer(function (req, res) {
// Check that WebTorrent declares a user agent
- t.equal(req.headers['user-agent'], 'WebTorrent (http://webtorrent.io)')
+ t.ok(req.headers['user-agent'].indexOf('WebTorrent') !== -1)
fs.createReadStream(blocklistPath).pipe(res)
})
@@ -166,7 +166,7 @@ test('blocklist (http url with gzip encoding)', function (t) {
t.plan(49)
var server = http.createServer(function (req, res) {
// Check that WebTorrent declares a user agent
- t.equal(req.headers['user-agent'], 'WebTorrent (http://webtorrent.io)')
+ t.ok(req.headers['user-agent'].indexOf('WebTorrent') !== -1)
res.setHeader('content-encoding', 'gzip')
fs.createReadStream(blocklistPath)
@@ -198,7 +198,7 @@ test('blocklist (http url with deflate encoding)', function (t) {
t.plan(49)
var server = http.createServer(function (req, res) {
// Check that WebTorrent declares a user agent
- t.equal(req.headers['user-agent'], 'WebTorrent (http://webtorrent.io)')
+ t.ok(req.headers['user-agent'].indexOf('WebTorrent') !== -1)
res.setHeader('content-encoding', 'deflate')
fs.createReadStream(blocklistPath)