Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 182684f

Browse files
committed
Feat: enable downloading hidden files
1 parent 6af709b commit 182684f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routers/http_router.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ router.get("/download/:key/:fileName", async (ctx) => {
4040
const fileAbsPath = fileManager.toAbsolutePath(fileRelativePath);
4141
const fileDir = path.dirname(fileAbsPath);
4242
const fileName = path.basename(fileAbsPath);
43-
ctx.set("Content-Type","application/octet-stream");
44-
await send(ctx, fileName, { root: fileDir + "/" });
43+
ctx.set("Content-Type", "application/octet-stream");
44+
await send(ctx, fileName, { root: fileDir + "/", hidden: true });
4545
} catch (error) {
4646
ctx.body = $t("http_router.downloadErr", { error: error.message });
4747
ctx.status = 500;

0 commit comments

Comments
 (0)