some code cleanup, fixed bug with regex in app.js
This commit is contained in:
parent
065f3c2014
commit
76c337836d
5 changed files with 16 additions and 23 deletions
3
app.js
3
app.js
|
@ -23,12 +23,13 @@ app.get("/download/:id", function(req, res) {
|
|||
|
||||
app.get("/assets/download/:id", function(req, res) {
|
||||
|
||||
let id = req.params.id;
|
||||
if (!validateID(id)){
|
||||
res.send(404);
|
||||
return;
|
||||
}
|
||||
|
||||
let id = req.params.id;
|
||||
|
||||
client.hget(id, "filename", function(err, reply) { // maybe some expiration logic too
|
||||
if (!reply) {
|
||||
res.sendStatus(404);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue