Browse files

added support for directory index file

  • Loading branch information...
1 parent e36a2c1 commit e8a57585d8c7a52270bfcd9970b37db64b4f5290 Aaron McCall committed Jun 18, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/staticGzip.js
View
3 lib/staticGzip.js
@@ -161,6 +161,9 @@ exports = module.exports = function staticGzip(dirPath, options){
return forbidden(res);
}
+ // directory index file support
+ if (filename.substr(-1) === '/') filename += 'index.html';
+
contentType = mime.lookup(filename);
charset = mime.charsets.lookup(contentType, 'UTF-8');
contentType = contentType + (charset ? '; charset=' + charset : '');

0 comments on commit e8a5758

Please sign in to comment.