mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-12 18:32:44 +00:00
fix: handle case when a repository does not exists
This commit is contained in:
@@ -18,7 +18,7 @@ router.get(
|
||||
res.attachment(`${repo.repoId}.zip`);
|
||||
|
||||
// ache the file for 6 hours
|
||||
res.header('Cache-Control', 'max-age=21600000');
|
||||
res.header("Cache-Control", "max-age=21600000");
|
||||
|
||||
repo.zip().pipe(res);
|
||||
} catch (error) {
|
||||
@@ -34,7 +34,7 @@ router.get(
|
||||
if (!repo) return;
|
||||
try {
|
||||
// ache the file for 6 hours
|
||||
res.header('Cache-Control', 'max-age=21600000');
|
||||
res.header("Cache-Control", "max-age=21600000");
|
||||
|
||||
res.json(await repo.anonymizedFiles({ includeSha: false }));
|
||||
} catch (error) {
|
||||
@@ -48,7 +48,7 @@ router.get(
|
||||
async (req: express.Request, res: express.Response) => {
|
||||
try {
|
||||
const repo = await getRepo(req, res, { nocheck: true });
|
||||
|
||||
if (!repo) throw new Error("repo_not_found");
|
||||
let redirectURL = null;
|
||||
if (
|
||||
repo.status == "expired" &&
|
||||
|
||||
Reference in New Issue
Block a user