diff options
author | Johannes <johannes@cloudron.io> | 2016-11-06 14:47:32 +0100 |
---|---|---|
committer | Johannes <johannes@cloudron.io> | 2016-11-06 14:47:32 +0100 |
commit | 5d361bf98214a6838f1beb886f0443dc7e1b0ab7 (patch) | |
tree | d0145c511063d020f30da27735c81086731a0b9e | |
parent | f65c7ea8a3235d499ff386af35520e13b8fc033c (diff) | |
download | Surfer-5d361bf98214a6838f1beb886f0443dc7e1b0ab7.tar.gz Surfer-5d361bf98214a6838f1beb886f0443dc7e1b0ab7.tar.zst Surfer-5d361bf98214a6838f1beb886f0443dc7e1b0ab7.zip |
Fix handling of paths with spaces
-rw-r--r-- | src/files.js | 2 |
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 | ||
114 | function put(req, res, next) { | 114 | function 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')); |