[Pkg-javascript-commits] [node-static] 129/151: Fix check for acceptEncoding header to work if there is no accept-encoding header

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Tue Jan 7 23:18:03 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 826e2b13c3fd685792176d42e3c0a0f21b80a8ca
Author: Dobes Vandermeer <dobesv at gmail.com>
Date:   Wed Nov 2 22:55:20 2011 +0800

    Fix check for acceptEncoding header to work if there is no accept-encoding header
---
 lib/node-static.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/node-static.js b/lib/node-static.js
index 1119f72..a862f26 100644
--- a/lib/node-static.js
+++ b/lib/node-static.js
@@ -232,7 +232,7 @@ this.Server.prototype.gzipOk = function(req, contentType) {
         (typeof enable === 'boolean' || 
             (contentType && (enable instanceof RegExp) && enable.test(contentType)))) {
         var acceptEncoding = req.headers['accept-encoding'];
-        return acceptEncoding.indexOf("gzip") >= 0;
+        return acceptEncoding && acceptEncoding.indexOf("gzip") >= 0;
     }
     return false;
 }

-- 
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