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:
Diffstat (limited to 'lib/server.js')
-rw-r--r--lib/server.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/server.js b/lib/server.js
index 263dcf7..64ce12f 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -3,7 +3,7 @@ const http = require('http')
const mime = require('mime')
const pump = require('pump')
const rangeParser = require('range-parser')
-const url = require('url')
+const URL = require('url').URL
function Server (torrent, opts = {}) {
const server = http.createServer()
@@ -77,7 +77,7 @@ function Server (torrent, opts = {}) {
}
function onRequest (req, res) {
- const pathname = url.parse(req.url).pathname
+ const pathname = new URL(req.url, 'http://example.com').pathname
if (pathname === '/favicon.ico') {
return serve404Page()