diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/server.js | 4 |
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>') |