Skip to content

Commit

Permalink
Merge pull request #154 from waifuvault/do-not-expose-file
Browse files Browse the repository at this point in the history
do not expose hidden filenames
  • Loading branch information
VictoriqueMoe committed Jun 4, 2024
2 parents 815b397 + 50351e2 commit 101487d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/controllers/serve/FileServerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ export class FileServerController {
// unknown> just send an octet stream and let the client figure it out
res.contentType("application/octet-stream");
}
res.attachment(entry.originalFileName);

if (entry.settings?.hideFilename) {
res.attachment(entry.fullFileNameOnSystem);
} else {
res.attachment(entry.originalFileName);
}

res.send(buff);
}

Expand Down

0 comments on commit 101487d

Please sign in to comment.