/files/ 下のヘッダ設定タイミングを修正 (#5650)

This commit is contained in:
MeiMei
2019-12-20 01:39:59 +09:00
committed by syuilo
parent 4229065a69
commit cbbdc98744
2 changed files with 13 additions and 13 deletions

View File

@@ -12,19 +12,14 @@ import sendDriveFile from './send-drive-file';
const app = new Koa();
app.use(cors());
app.use(async (ctx, next) => {
// Cache 365days
ctx.set('Cache-Control', 'max-age=31536000, immutable');
await next();
});
// Init router
const router = new Router();
router.get('/app-default.jpg', ctx => {
const file = fs.createReadStream(`${__dirname}/assets/dummy.png`);
ctx.set('Content-Type', 'image/jpeg');
ctx.body = file;
ctx.set('Content-Type', 'image/jpeg');
ctx.set('Cache-Control', 'max-age=31536000, immutable');
});
router.get('/:key', sendDriveFile);