ダウンロードURLにdownloadを付けないなど (#5488)

This commit is contained in:
MeiMei 2019-10-04 20:18:41 +09:00 committed by syuilo
parent 2671c6b4f2
commit d17c6adba4
3 changed files with 4 additions and 7 deletions

View file

@ -46,9 +46,7 @@ export default async function(ctx: Koa.BaseContext) {
ctx.set('Content-Disposition', contentDisposition('inline', `${rename(file.name, { suffix: '-web' })}`));
ctx.body = InternalStorage.read(key);
} else {
if ('download' in ctx.query) {
ctx.set('Content-Disposition', contentDisposition('attachment', `${file.name}`));
}
ctx.set('Content-Disposition', contentDisposition('inline', `${file.name}`));
const readable = InternalStorage.read(file.accessKey!);
readable.on('error', commonReadableHandlerGenerator(ctx));