quickfix for cached html

This commit is contained in:
daniel-j
2024-07-21 15:18:22 +02:00
parent c1b6f9d3ea
commit 75eb5c4eda
2 changed files with 17 additions and 3 deletions

View File

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