mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
feat(#171): supports display raw content
This commit is contained in:
@@ -31,9 +31,11 @@ router.get(
|
||||
object: f,
|
||||
});
|
||||
}
|
||||
res.attachment(
|
||||
anonymizedPath.substring(anonymizedPath.lastIndexOf("/") + 1)
|
||||
);
|
||||
if (req.query.download) {
|
||||
res.attachment(
|
||||
anonymizedPath.substring(anonymizedPath.lastIndexOf("/") + 1)
|
||||
);
|
||||
}
|
||||
// cache the file for 5min
|
||||
res.header("Cache-Control", "max-age=300");
|
||||
await Promise.all([repo.countView(), f.send(res)]);
|
||||
|
||||
@@ -126,7 +126,7 @@ export default async function start() {
|
||||
res.json({
|
||||
nbRepositories,
|
||||
nbUsers: users.length,
|
||||
nbPageViews: nbPageViews[0].total,
|
||||
nbPageViews: nbPageViews[0]?.total || 0,
|
||||
nbPullRequests,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user