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:
authorGilles De Mey <gilles.de.mey@gmail.com>2015-09-03 02:13:32 +0300
committerGilles De Mey <gilles.de.mey@gmail.com>2015-09-03 02:13:32 +0300
commit2ca0f17ddb7c31be5ff0dd2333d70888b15009b6 (patch)
treecf45325f1f27785b96ef7bf74be3bd9e739fc441 /index.js
parentd70b5a42eed0a96a824e5e4ffc7485a6c6a19153 (diff)
Clone options when seeding/downloading
Diffstat (limited to 'index.js')
-rw-r--r--index.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/index.js b/index.js
index 1f24c4b..f44e386 100644
--- a/index.js
+++ b/index.js
@@ -145,6 +145,7 @@ WebTorrent.prototype.download = function (torrentId, opts, ontorrent) {
if (typeof opts === 'function') return self.add(torrentId, null, opts)
debug('add')
if (!opts) opts = {}
+ else opts = extend({}, opts)
opts.client = self
@@ -192,6 +193,7 @@ WebTorrent.prototype.seed = function (input, opts, onseed) {
if (typeof opts === 'function') return self.seed(input, null, opts)
debug('seed')
if (!opts) opts = {}
+ else opts = extend({}, opts)
// When seeding from filesystem, initialize store from that path (avoids a copy)
if (typeof input === 'string') opts.path = path.dirname(input)