mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-12 18:32:44 +00:00
fix: catch error when requesting a folder
This commit is contained in:
@@ -25,12 +25,12 @@ router.post("/", async (req: express.Request, res: express.Response) => {
|
||||
commit: commit,
|
||||
getToken: () => token,
|
||||
});
|
||||
const content = await source.getFileContentCache(
|
||||
filePath,
|
||||
repoId,
|
||||
() => fileSha
|
||||
);
|
||||
try {
|
||||
const content = await source.getFileContentCache(
|
||||
filePath,
|
||||
repoId,
|
||||
() => fileSha
|
||||
);
|
||||
const mime = lookup(filePath);
|
||||
if (mime && !filePath.endsWith(".ts")) {
|
||||
res.contentType(mime);
|
||||
|
||||
Reference in New Issue
Block a user