mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-06 05:38:09 +02:00
fix: fix best match for index
This commit is contained in:
@@ -54,7 +54,6 @@ async function webView(req: express.Request, res: express.Response) {
|
|||||||
repository: repo,
|
repository: repo,
|
||||||
anonymizedPath: requestPath,
|
anonymizedPath: requestPath,
|
||||||
});
|
});
|
||||||
console.log(f);
|
|
||||||
if (requestPath[requestPath.length - 1] == "/") {
|
if (requestPath[requestPath.length - 1] == "/") {
|
||||||
// find index file
|
// find index file
|
||||||
const paths = f.anonymizedPath.trim().split("/");
|
const paths = f.anonymizedPath.trim().split("/");
|
||||||
@@ -75,13 +74,12 @@ async function webView(req: express.Request, res: express.Response) {
|
|||||||
}
|
}
|
||||||
currentAnonymized = currentAnonymized[fileName];
|
currentAnonymized = currentAnonymized[fileName];
|
||||||
}
|
}
|
||||||
console.log(currentAnonymized);
|
|
||||||
|
|
||||||
let best_match = null;
|
let best_match = null;
|
||||||
for (const p of indexPriority) {
|
for (const p of indexPriority) {
|
||||||
for (let filename in currentAnonymized) {
|
for (let filename in currentAnonymized) {
|
||||||
if (filename.toLowerCase() == p) {
|
if (filename.toLowerCase() == p) {
|
||||||
best_match = p;
|
best_match = filename;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user