aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJohannes <johannes@cloudron.io>2016-11-06 14:47:32 +0100
committerJohannes <johannes@cloudron.io>2016-11-06 14:47:32 +0100
commit5d361bf98214a6838f1beb886f0443dc7e1b0ab7 (patch)
treed0145c511063d020f30da27735c81086731a0b9e /src
parentf65c7ea8a3235d499ff386af35520e13b8fc033c (diff)
downloadSurfer-5d361bf98214a6838f1beb886f0443dc7e1b0ab7.tar.gz
Surfer-5d361bf98214a6838f1beb886f0443dc7e1b0ab7.tar.zst
Surfer-5d361bf98214a6838f1beb886f0443dc7e1b0ab7.zip
Fix handling of paths with spaces
Diffstat (limited to 'src')
-rw-r--r--src/files.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/files.js b/src/files.js
index 99b3aa2..6c67539 100644
--- a/src/files.js
+++ b/src/files.js
@@ -112,7 +112,7 @@ function get(req, res, next) {
112} 112}
113 113
114function put(req, res, next) { 114function put(req, res, next) {
115 var filePath = req.params[0]; 115 var filePath = decodeURIComponent(req.params[0]);
116 116
117 if (!(req.files && req.files.file) && !req.query.directory) return next(new HttpError(400, 'missing file or directory')); 117 if (!(req.files && req.files.file) && !req.query.directory) return next(new HttpError(400, 'missing file or directory'));
118 if ((req.files && req.files.file) && req.query.directory) return next(new HttpError(400, 'either file or directory')); 118 if ((req.files && req.files.file) && req.query.directory) return next(new HttpError(400, 'either file or directory'));