Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

loosen restriction on freshness headers

  • Loading branch information...
commit 6093ebccd2f08933aa7930813a791af07e72fdd0 1 parent 61ed9c9
@cloudhead authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/node-static.js
View
4 lib/node-static.js
@@ -188,9 +188,9 @@ this.Server.prototype.respond = function (pathname, status, _headers, files, sta
headers['Last-Modified'] = new(Date)(stat.mtime).toUTCString();
// Conditional GET
- // If both the "If-Modified-Since" and "If-None-Match" headers
+ // If the "If-Modified-Since" or "If-None-Match" headers
// match the conditions, send a 304 Not Modified.
- if (req.headers['if-none-match'] === headers['Etag'] &&
+ if (req.headers['if-none-match'] === headers['Etag'] ||
Date.parse(req.headers['if-modified-since']) >= mtime) {
finish(304, headers);
} else if (req.method === 'HEAD') {
Please sign in to comment.
Something went wrong with that request. Please try again.