diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-06-22 11:39:02 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-06-22 11:39:02 +0300 |
commit | 040f65c67ff1ae57d35a0bd7d648c0dd49a4b425 (patch) | |
tree | c1d80a19a01d2b607f2714bfda2686576d57fd8a /lib | |
parent | 8fbd31310d91070a9b8bd7b4a15e07669e884133 (diff) |
WebTorrent http server: Fix HEAD requests
Don't send the entire response body
Diffstat (limited to 'lib')
-rw-r--r-- | lib/server.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/server.js b/lib/server.js index cfa883f..911da59 100644 --- a/lib/server.js +++ b/lib/server.js @@ -125,7 +125,11 @@ function Server (torrent, opts) { } else { res.setHeader('Content-Length', file.length) } - if (req.method === 'HEAD') res.end() + + if (req.method === 'HEAD') { + return res.end() + } + pump(file.createReadStream(range), res) } } |