diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2019-07-05 07:37:12 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2019-07-05 07:37:12 +0300 |
commit | 7d747efeca17a20298c51e2f393e38622c4053cd (patch) | |
tree | b41b34e27ecb832c78104001af647fd784e9d5ad /lib | |
parent | 12760635bdfa76df1de7c89c174b01c2ab891a2f (diff) |
'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead
Diffstat (limited to 'lib')
-rw-r--r-- | lib/server.js | 4 | ||||
-rw-r--r-- | lib/torrent.js | 2 |
2 files changed, 3 insertions, 3 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() diff --git a/lib/torrent.js b/lib/torrent.js index 8f667ff..39a725f 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1,4 +1,4 @@ -/* global URL, Blob */ +/* global Blob */ const addrToIPPort = require('addr-to-ip-port') const BitField = require('bitfield') |