From 963797121a93d531e61d2bbac265ae1c0cf679a4 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Wed, 21 Apr 2021 22:34:45 +0200 Subject: [PATCH] fix image resolution --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index ab61288..89baa07 100644 --- a/index.js +++ b/index.js @@ -78,7 +78,7 @@ function indexResponse(req, res) { if (req.params.repoId && req.headers["accept"] && req.headers["accept"].indexOf("text/html") == -1) { const repoId = req.path.split("/")[2]; // if it is not an html request, it assumes that the browser try to load a different type of resource - return res.redirect(`/api/repo/${repoId}/file/${req.path.substring(req.path.indexOf(repoId) + 1)}`); + return res.redirect(`/api/repo/${repoId}/file/${req.path.substring(req.path.indexOf(repoId) + repoId.length + 1)}`); } res.sendFile(path.resolve(__dirname, "public", "index.html")); }