Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: cloudhead/node-static
base: ae7776fa63
...
head fork: cloudhead/node-static
compare: 85377fdab0
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/node-static.js
View
7 lib/node-static.js
@@ -192,8 +192,6 @@ this.Server.prototype.respond = function (pathname, status, _headers, files, sta
if (req.headers['if-none-match'] === headers['ETag'] ||
Date.parse(req.headers['if-modified-since']) >= mtime) {
finish(304, headers);
- } else if (req.method === 'HEAD') {
- finish(200, headers);
} else {
var fileExtension = path.extname(files[0]).slice(1).toLowerCase();
headers['Content-Length'] = stat.size;
@@ -204,6 +202,11 @@ this.Server.prototype.respond = function (pathname, status, _headers, files, sta
res.writeHead(status, headers);
+ if (req.method === 'HEAD') {
+ finish(200, headers);
+ return;
+ }
+
// If the file was cached and it's not older
// than what's on disk, serve the cached version.
if (this.cache && (key in exports.store) &&

No commit comments for this range

Something went wrong with that request. Please try again.