This commit is contained in:
syuilo
2018-04-13 07:34:27 +09:00
parent c54ff5b2bc
commit 61f21594a9
4 changed files with 20 additions and 20 deletions

View File

@ -80,10 +80,11 @@ export default function(readable: stream.Readable, type: string, ctx: Koa.Contex
}
if (ctx.query.download !== undefined) {
ctx.header('Content-Disposition', 'attachment');
ctx.set('Content-Disposition', 'attachment');
}
ctx.header('Content-Type', data.contentType);
ctx.set('Cache-Control', 'max-age=31536000, immutable');
ctx.set('Content-Type', data.contentType);
data.stream.pipe(ctx.res);