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/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/server.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/server.js b/lib/server.js
index ea4f319..af1665d 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -107,7 +107,7 @@ function Server (torrent, requestListener) {
return serveIndexPage()
}
- var index = Number(pathname.slice(1))
+ var index = Number(pathname.split('/')[1])
if (Number.isNaN(index) || index >= torrent.files.length) {
return serve404Page()
}
@@ -121,7 +121,7 @@ function Server (torrent, requestListener) {
res.setHeader('Content-Type', 'text/html')
var listHtml = torrent.files.map(function (file, i) {
- return '<li><a download="' + file.name + '" href="/' + i + '">' + file.path + '</a> ' +
+ return '<li><a download="' + file.name + '" href="/' + i + '/' + file.name + '">' + file.path + '</a> ' +
'(' + file.length + ' bytes)</li>'
}).join('<br>')