Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit f5bbaf5d2f85990e6b23f899b397e7e2f6bf97c4 2 parents 30bd18a + 472c01a
Devin Torres authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/node-router.js
2  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);
Please sign in to comment.
Something went wrong with that request. Please try again.