diff options
Diffstat (limited to 'lib/server.js')
-rw-r--r-- | lib/server.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/server.js b/lib/server.js index d0f5716..5b24181 100644 --- a/lib/server.js +++ b/lib/server.js @@ -54,10 +54,8 @@ function Server (torrent, opts) { // If a 'hostname' string is specified, deny requests with a 'Host' // header that does not match the origin of the torrent server to prevent // DNS rebinding attacks. - if (opts.hostname) { - if (req.headers.host !== `${opts.hostname}:${server.address().port}`) { - return false - } + if (opts.hostname && req.headers.host !== `${opts.hostname}:${server.address().port}`) { + return false } // The user allowed all origins |