Skip to content
Permalink
Browse files

Filter path names

  • Loading branch information...
henrytseng committed Dec 14, 2016
1 parent 5827ba4 commit 789a00047459fd80b6f0a9701a1378a47fb73ba8
Showing with 4 additions and 2 deletions.
  1. +3 −1 lib/routes/statics.js
  2. +1 −1 package.json
@@ -23,7 +23,9 @@ module.exports = function(options) {

var _handler = function(req, res, next) {
var resource = url.parse(req.url);
var filePath = process.cwd()+(resource.pathname || '/');
var resourcePathname = resource.pathname || '/';
resourcePathname = resourcePathname.replace(/\/\.\./, "").replace(/\.\.\//, "");
var filePath = process.cwd()+resourcePathname;

if(filePath[filePath.length-1] === '/') filePath += 'index.html';

@@ -1,6 +1,6 @@
{
"name": "hostr",
"version": "2.3.5",
"version": "2.3.6",
"description": "A simple web server for the current working directory. Used for hello world style web sites hosting only files in current directory structure. Watches files and integrates with LiveReload.",
"repository": {
"type": "git",

0 comments on commit 789a000

Please sign in to comment.
You can’t perform that action at this time.