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:
authorValérian Galliat <val@codejam.info>2015-10-02 16:22:48 +0300
committerValérian Galliat <val@codejam.info>2015-10-02 16:22:48 +0300
commita0d212c8882fb5dbbeabc27b861e79980b6dd52e (patch)
tree72762fd9078d988eb77b1d6d7fd3d94f22ee6a6c /index.js
parentf9b37e422316414fe156ac0d1c8e84447f62c4ba (diff)
parent2ca0f17ddb7c31be5ff0dd2333d70888b15009b6 (diff)
Merge pull request #418 from gillesdemey/dev-clone-options
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 4f4577d..9e783be 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)