quickfix for cached html
This commit is contained in:
17
index.js
17
index.js
@@ -164,6 +164,23 @@ router.post('/generate', async ctx => {
|
||||
ctx.body = key
|
||||
})
|
||||
|
||||
router.get('/download/:key', async ctx => {
|
||||
const key = ctx.cookies.get('key')
|
||||
if (!key) {
|
||||
await next()
|
||||
return
|
||||
}
|
||||
|
||||
const info = ctx.keys.get(key)
|
||||
|
||||
if (!info || !info.file) {
|
||||
await next()
|
||||
return
|
||||
}
|
||||
|
||||
ctx.redirect('/' + encodeURIComponent(info.file.name));
|
||||
})
|
||||
|
||||
async function downloadFile (ctx, next) {
|
||||
const key = ctx.cookies.get('key')
|
||||
if (!key) {
|
||||
|
||||
Reference in New Issue
Block a user