From 2ca0f17ddb7c31be5ff0dd2333d70888b15009b6 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Thu, 3 Sep 2015 01:13:32 +0200 Subject: Clone options when seeding/downloading --- index.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'index.js') 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) -- cgit v1.2.3