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

Commit 4bd60b8

Browse files
authored
Merge pull request #58 from Bluemangoo/942
Feat: enable downloading hidden files
2 parents 6af709b + 182684f commit 4bd60b8

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)