Permalink
Browse files

Fix support for spaces in filenames using decodeURIComponent.

  • Loading branch information...
1 parent 027241e commit e17a0c4f794dd805959c37cec4e428d0f7388b93 @omphalos committed Nov 22, 2014
Showing with 3 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +1 −0 crud-file-server.js
  3. +1 −1 package.json
View
@@ -0,0 +1 @@
+node_modules
View
@@ -2,6 +2,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('..', ''); }
return url;
};
View
@@ -1,6 +1,6 @@
{
"name": "crud-file-server",
- "version": "0.5.0",
+ "version": "0.6.0",
"description": "file server supporting basic create, read, update, & delete for any kind of file",
"bin": {
"crud-file-server": "./bin/crud-file-server"

0 comments on commit e17a0c4

Please sign in to comment.