From e9b881872b029fb09c52a54cba331fa7e8df078a Mon Sep 17 00:00:00 2001 From: Muthu Kumar Date: Wed, 20 Mar 2019 00:07:22 +0530 Subject: [PATCH] [fix] Only redirect if it's not already index.php --- plugins/nextcloud-md.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/nextcloud-md.js b/plugins/nextcloud-md.js index be1ecec..7719fab 100644 --- a/plugins/nextcloud-md.js +++ b/plugins/nextcloud-md.js @@ -1 +1,4 @@ -module.exports = app => app.use((req, res, next) => res.redirect('/index.php' + req.originalUrl)); \ No newline at end of file +module.exports = app => app.use((req, res, next) => + req.originalUrl.includes('index.php') + ? next() + : res.redirect('/index.php' + req.originalUrl));