Use async function instead of promise (#325)

This commit is contained in:
Weihang Lo 2017-08-03 13:31:23 +08:00
parent bbe111a95e
commit 596ad871df
No known key found for this signature in database
GPG key ID: D7DBF189825E82E7

View file

@ -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),