Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix canonicalization of directories
  • Loading branch information
omphalos committed Feb 16, 2018
1 parent 833e7fc commit 4fc3b40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crud-file-server.js
Expand Up @@ -3,7 +3,7 @@ var fs = require('fs');
// don't let users crawl up the folder structure by using a/../../../c/d
var cleanUrl = function(url) {
url = decodeURIComponent(url);
while(url.indexOf('..').length > 0) { url = url.replace('..', ''); }
while(url.indexOf('..') >= 0) { url = url.replace('..', ''); }
return url;
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "crud-file-server",
"version": "0.8.0",
"version": "0.9.0",
"description": "file server supporting basic create, read, update, & delete for any kind of file",
"bin": {
"crud-file-server": "./bin/crud-file-server"
Expand Down

0 comments on commit 4fc3b40

Please sign in to comment.