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:
authorFeross Aboukhadijeh <feross@feross.org>2015-05-24 20:17:15 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-05-24 20:17:15 +0300
commitc995701f872613d69f86af989dd94b0d7e949746 (patch)
tree2871686b132c4bec0e21cfdc295ff987f2256e69
parent8fb93572b170e25b3fe0058260edc1541acc6796 (diff)
handle uppercase file extension names
-rwxr-xr-xbin/cmd.js2
-rw-r--r--lib/file-stream.js2
-rw-r--r--lib/storage.js2
3 files changed, 3 insertions, 3 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index b05830b..4c9b343 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -429,7 +429,7 @@ function runDownload (torrentId) {
}
function runSeed (input) {
- if (path.extname(input) === '.torrent' || /^magnet:/.test(input)) {
+ if (path.extname(input).toLowerCase() === '.torrent' || /^magnet:/.test(input)) {
// `webtorrent seed` is meant for creating a new torrent based on a file or folder
// of content, not a torrent id (.torrent or a magnet uri). If this command is used
// incorrectly, let's just do the right thing.
diff --git a/lib/file-stream.js b/lib/file-stream.js
index 5f00191..937d5d6 100644
--- a/lib/file-stream.js
+++ b/lib/file-stream.js
@@ -35,7 +35,7 @@ function FileStream (file, opts) {
self.startPiece = offset / pieceLength | 0
self.endPiece = (opts.end + file.offset) / pieceLength | 0
- self._extname = path.extname(file.name)
+ self._extname = path.extname(file.name).toLowerCase()
self._storage = file.storage
self._piece = self.startPiece
self._missing = self.length
diff --git a/lib/storage.js b/lib/storage.js
index dab04a0..805c498 100644
--- a/lib/storage.js
+++ b/lib/storage.js
@@ -283,7 +283,7 @@ File.prototype.getBlobURL = function (cb) {
self.getBuffer(function (err, buffer) {
if (err) return cb(err)
- var type = mime[path.extname(self.name)]
+ var type = mime[path.extname(self.name).toLowerCase()]
var blob = type
? new window.Blob([ buffer ], { type: type })
: new window.Blob([ buffer ])