/files/ 下のヘッダ設定タイミングを修正 (#5650)
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user