Skip to content

Commit

Permalink
fix: 节点专属通道下载不到文件
Browse files Browse the repository at this point in the history
  • Loading branch information
SALTWOOD committed Aug 27, 2024
1 parent 5c6fbff commit 8c71568
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ export class Server {
const hash = req.params.hash.toLowerCase();
const file = this.files.find(f => f.hash === hash);
if (file) {
res.sendFile(path.join(__dirname, file.path.substring(1)));
res.sendFile(file.path.substring(1), {
root: ".",
maxAge: "30d"
});
} else {
res.status(404).send();
}
Expand Down

0 comments on commit 8c71568

Please sign in to comment.