Skip to content

Commit

Permalink
[vendor] Updated node-static API. Renamed 'AutoIndex' => 'autoIndex'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marak committed Aug 25, 2011
1 parent 68a7b2f commit 39374ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions vendor/node-static/README.md
Expand Up @@ -139,11 +139,11 @@ example: `{ 'X-Hello': 'World!' }`

> Defaults to `{}`
#### `AutoIndex` #
#### `autoIndex` #

Automatically generates an html index page for directory listings

example: `{ 'AutoIndex': true }`
example: `{ 'autoIndex': true }`

> Defaults to `false`
8 changes: 4 additions & 4 deletions vendor/node-static/lib/node-static.js
Expand Up @@ -25,7 +25,7 @@ this.Server = function (root, options) {

this.defaultHeaders = {};
this.options.headers = this.options.headers || {};
this.options.AutoIndex = this.options.AutoIndex || false;
this.options.autoIndex = this.options.autoIndex || false;

if ('cache' in this.options) {
if (typeof(this.options.cache) === 'number') {
Expand Down Expand Up @@ -60,8 +60,8 @@ this.Server.prototype.serveDir = function (pathname, req, res, finish) {
// Stream a directory of files as a single file.
fs.readFile(path.join(pathname, 'index.json'), function (e, contents) {
if (e) {
if (that.options.AutoIndex === true || that.options.AutoIndex === "true") {
return that.serveAutoIndex(pathname, res, req, finish);
if (that.options.autoIndex === true || that.options.autoIndex === "true") {
return that.serveautoIndex(pathname, res, req, finish);
} else {
return finish(404, {});
}
Expand Down Expand Up @@ -229,7 +229,7 @@ this.Server.prototype.respond = function (pathname, status, _headers, files, sta
}
}
};
this.Server.prototype.serveAutoIndex = function (dirPath, res, req, finish) {
this.Server.prototype.serveautoIndex = function (dirPath, res, req, finish) {
var html,
self = this,
urlBase = '',
Expand Down

0 comments on commit 39374ce

Please sign in to comment.