From 94ff5399e8f067a1beef899950c789be64ab36f3 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 6 Nov 2016 15:06:31 +0100 Subject: [PATCH] URI decode all paths --- src/files.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/files.js b/src/files.js index 6c67539..747acf7 100644 --- a/src/files.js +++ b/src/files.js @@ -77,7 +77,7 @@ function removeBasePath(filePath) { } function get(req, res, next) { - var filePath = req.params[0]; + var filePath = decodeURIComponent(req.params[0]); var absoluteFilePath = getAbsolutePath(filePath); if (!absoluteFilePath) return next(new HttpError(403, 'Path not allowed')); @@ -145,7 +145,7 @@ function put(req, res, next) { } function del(req, res, next) { - var filePath = req.params[0]; + var filePath = decodeURIComponent(req.params[0]); var recursive = !!req.query.recursive; var dryRun = !!req.query.dryRun; -- 2.41.0