fix image resolution

This commit is contained in:
tdurieux
2021-04-21 22:34:45 +02:00
parent bce2e0f785
commit 963797121a

View File

@@ -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"));
}