fix(#283): Fix webview for web in folder

This commit is contained in:
tdurieux
2024-04-30 11:28:32 +01:00
parent 3a00a27153
commit 3536f78a99
+3 -2
View File
@@ -56,11 +56,12 @@ async function webView(req: express.Request, res: express.Response) {
repository: repo, repository: repo,
anonymizedPath: requestPath, anonymizedPath: requestPath,
}); });
if (requestPath == "" && req.headers.accept?.includes("text/html")) { if (filePath == "" && req.headers.accept?.includes("text/html")) {
// look for index file // look for index file
const candidates = await repo.files({ const candidates = await repo.files({
recursive: false, recursive: false,
path: "", // look for file at the root of the page source
path: wRoot.substring(1),
}); });
let bestMatch = null; let bestMatch = null;