Use async function instead of promise (#325)
This commit is contained in:
parent
bbe111a95e
commit
596ad871df
|
@ -142,7 +142,7 @@ app.get('/download/:id', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const filename = await storage.filename(id);
|
const filename = await storage.filename(id);
|
||||||
const contentLength = await storage.length(id);
|
const contentLength = await storage.length(id);
|
||||||
const timeToExpiry = storage.ttl(id);
|
const timeToExpiry = await storage.ttl(id);
|
||||||
res.render('download', {
|
res.render('download', {
|
||||||
filename: decodeURIComponent(filename),
|
filename: decodeURIComponent(filename),
|
||||||
filesize: bytes(contentLength),
|
filesize: bytes(contentLength),
|
||||||
|
|
Loading…
Reference in New Issue