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
path: root/test
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2015-08-22 15:46:27 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-08-22 15:46:27 +0300
commit4ccd9667ddaeb97c6aa50bc36311a242c0d02c70 (patch)
tree05994f5fd5156deb905b7b3d7ba8f205dd494062 /test
parent958f30a0341ca323c7cef794b00fe38eed845297 (diff)
Include web torrent version in http user agent
Diffstat (limited to 'test')
-rw-r--r--test/basic-node.js2
-rw-r--r--test/blocklist.js6
2 files changed, 4 insertions, 4 deletions
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)