1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-27 22:38:30 +09:00

No caching /api/ (#3411)

This commit is contained in:
MeiMei 2018-11-27 01:16:25 +09:00 committed by syuilo
parent 33243e7176
commit b6fd5d7282

View File

@ -19,6 +19,12 @@ app.use(cors({
origin: '*'
}));
// No caching
app.use(async (ctx, next) => {
ctx.set('Cache-Control', 'private, max-age=0, must-revalidate');
await next();
});
app.use(bodyParser({
// リクエストが multipart/form-data でない限りはJSONだと見なす
detectJSON: ctx => !ctx.is('multipart/form-data')