Skip to content

Commit

Permalink
fix sendFile path
Browse files Browse the repository at this point in the history
  • Loading branch information
f0x52 committed May 20, 2024
1 parent 9e3dff3 commit 6e013f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/plugins/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ class Uploader {
res.setHeader("Content-Disposition", disposition);
res.contentType(detectedMimeType);

return res.sendFile(filePath, {
// using unsafePath because it's safely resolved against 'root' by sendFile
return res.sendFile(unsafePath, {
root: uploadPath,
maxAge: 86400
});
Expand Down

0 comments on commit 6e013f9

Please sign in to comment.