Permalink
Browse files

Merge branch 'master' of git://github.com/creationix/node-router

  • Loading branch information...
2 parents 30bd18a + 472c01a commit f5bbaf5d2f85990e6b23f899b397e7e2f6bf97c4 Devin Torres committed Apr 2, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/node-router.js
View
@@ -311,7 +311,7 @@ exports.staticDirHandler = function(root, prefix) {
var filename = req.url.replace(/[\?#].*$/, '');
if (prefix) filename = filename.replace(new RegExp('^'+prefix), '');
// make sure nobody can explore our local filesystem
- filename = path.join(root, filename.replace(/\.\./g, '.'));
+ filename = path.join(root, filename.replace(/\.\.+/g, '.'));
if (filename == root) filename = path.join(root, 'index.html');
loadResponseData(req, res, filename, function(headers, body, encoding) {
res.writeHead(200, headers);

0 comments on commit f5bbaf5

Please sign in to comment.