Skip to content

Commit

Permalink
don't send file in HEAD requests
Browse files Browse the repository at this point in the history
in current nodes, doing so will raise an exception at which point the
file will never be closed. This leads to file handle starvation sooner
or later
  • Loading branch information
pilif authored and felixge committed Jun 30, 2010
1 parent 6587d29 commit 8c37d6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paperboy.js
Expand Up @@ -47,7 +47,7 @@ exports.streamFile = function (filepath, headerFields, stat, res, req, emitter)
res.writeHead(statCode, headerFields);

//If we sent a 304, skip sending a body
if (statCode == 304) {
if (statCode == 304 || req.method === 'HEAD') {
res.end();
emitter.emit("success", statCode);
}
Expand Down

0 comments on commit 8c37d6f

Please sign in to comment.