From e759555bf98ad404f139dace0f5afa02591a1d4a Mon Sep 17 00:00:00 2001 From: tdurieux Date: Wed, 7 Sep 2022 11:10:13 +0200 Subject: [PATCH] fix: fix best match for index --- src/routes/webview.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/routes/webview.ts b/src/routes/webview.ts index 16a55b2..7a11cb7 100644 --- a/src/routes/webview.ts +++ b/src/routes/webview.ts @@ -54,7 +54,6 @@ async function webView(req: express.Request, res: express.Response) { repository: repo, anonymizedPath: requestPath, }); - console.log(f); if (requestPath[requestPath.length - 1] == "/") { // find index file const paths = f.anonymizedPath.trim().split("/"); @@ -75,13 +74,12 @@ async function webView(req: express.Request, res: express.Response) { } currentAnonymized = currentAnonymized[fileName]; } - console.log(currentAnonymized); let best_match = null; for (const p of indexPriority) { for (let filename in currentAnonymized) { if (filename.toLowerCase() == p) { - best_match = p; + best_match = filename; break; } }