From: Johannes Date: Sun, 6 Nov 2016 13:47:32 +0000 (+0100) Subject: Fix handling of paths with spaces X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;ds=sidebyside;h=5d361bf98214a6838f1beb886f0443dc7e1b0ab7;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git Fix handling of paths with spaces --- 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) { } function put(req, res, next) { - var filePath = req.params[0]; + var filePath = decodeURIComponent(req.params[0]); if (!(req.files && req.files.file) && !req.query.directory) return next(new HttpError(400, 'missing file or directory')); if ((req.files && req.files.file) && req.query.directory) return next(new HttpError(400, 'either file or directory'));