Bug fixed.

This commit is contained in:
Daniel 2022-06-21 20:32:59 +04:30
parent ed0ab482a7
commit b313046580

View File

@ -49,11 +49,14 @@ app.get("/screenshots/:id", async (req, res) => {
}); });
app.get("/pdfs/:id", async (req, res) => { app.get("/pdfs/:id", async (req, res) => {
res.sendFile(pdfDirectory + "/" + sanitize(req.params.id), (err) => { res.sendFile(
if (err) { __dirname + "/" + pdfDirectory + "/" + sanitize(req.params.id),
res.sendFile(__dirname + "/pages/404.html"); (err) => {
if (err) {
res.sendFile(__dirname + "/pages/404.html");
}
} }
}); );
}); });
app.post("/api", async (req, res) => { app.post("/api", async (req, res) => {