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:
authorFeross Aboukhadijeh <feross@feross.org>2016-06-22 11:39:02 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-06-22 11:39:02 +0300
commit040f65c67ff1ae57d35a0bd7d648c0dd49a4b425 (patch)
treec1d80a19a01d2b607f2714bfda2686576d57fd8a /lib/server.js
parent8fbd31310d91070a9b8bd7b4a15e07669e884133 (diff)
WebTorrent http server: Fix HEAD requests
Don't send the entire response body
Diffstat (limited to 'lib/server.js')
-rw-r--r--lib/server.js6
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)
}
}