[Pkg-javascript-commits] [node-static] 57/151: fixes casing of ETag

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Tue Jan 7 23:17:58 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 2359b93ab9263481bf37e3bae2538eaf04bd3910
Author: pbouzakis <github at paulbouzakis.com>
Date:   Fri Apr 6 13:46:16 2012 -0400

    fixes casing of ETag
---
 lib/node-static.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/node-static.js b/lib/node-static.js
index 9399257..55e04f4 100644
--- a/lib/node-static.js
+++ b/lib/node-static.js
@@ -158,7 +158,7 @@ this.Server.prototype.resolve = function (pathname) {
 this.Server.prototype.serve = function (req, res, callback) {
     var that = this,
         promise = new(events.EventEmitter);
-    
+
     var pathname = decodeURI(url.parse(req.url).pathname);
 
     var finish = function (status, headers) {
@@ -183,14 +183,14 @@ this.Server.prototype.respond = function (pathname, status, _headers, files, sta
     // Copy default headers
     for (var k in this.options.headers) {  headers[k] = this.options.headers[k] }
 
-    headers['Etag']          = JSON.stringify([stat.ino, stat.size, mtime].join('-'));
+    headers['ETag']          = JSON.stringify([stat.ino, stat.size, mtime].join('-'));
     headers['Date']          = new(Date)().toUTCString();
     headers['Last-Modified'] = new(Date)(stat.mtime).toUTCString();
 
     // Conditional GET
     // 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