aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2019-11-17 00:05:50 +0100
committerache <ache@ache.one>2019-11-17 00:05:50 +0100
commit5d17ec8cf7480ad3d34a1d2d4b06b3a406c1529a (patch)
treeb781320b89e430a358b21ec1cfab59fe6ba6e0cd
parentAdd save button (diff)
Deal with encoded URLHEADmaster
-rw-r--r--app.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app.js b/app.js
index 71ad164..79c8085 100644
--- a/app.js
+++ b/app.js
@@ -98,7 +98,7 @@ app.get('/', (req, res) => {
app.get('/edit/?*', (req, res) => {
console.log(`[${new Date()}] > ${200} - ${req.url}`);
- const pathReq = path.normalize(`md/${req.url.slice(5)}`);
+ const pathReq = decodeURIComponent(path.normalize(`md/${req.url.slice(5)}`));
console.log(`[${new Date()}] > ${200} - ${pathReq}`);
@@ -111,7 +111,7 @@ app.get('/edit/?*', (req, res) => {
});
});
app.put('/edit/?*', (req, res) => {
- const pathR = path.normalize(`md${req.url.slice(5)}`);
+ const pathR = decodeURIComponent(path.normalize(`md${req.url.slice(5)}`));
console.log('PUT !');
console.log(pathR);
if (pathR.startsWith('md/public') ||