[Pkg-javascript-commits] [node-static] 47/151: loosen restriction on freshness headers
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Tue Jan 7 23:17:57 UTC 2014
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch master
in repository node-static.
commit 6093ebccd2f08933aa7930813a791af07e72fdd0
Author: cloudhead <alexis at cloudhead.io>
Date: Fri Jul 22 12:36:33 2011 -0400
loosen restriction on freshness headers
---
lib/node-static.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/node-static.js b/lib/node-static.js
index 1188e8a..2cddd99 100644
--- a/lib/node-static.js
+++ b/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') {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-static.git
More information about the Pkg-javascript-commits
mailing list