Tune AP URL negotiating with Accept (#3824)

This commit is contained in:
MeiMei
2019-01-02 18:07:32 +09:00
committed by syuilo
parent 96515c4544
commit 41e3a9a004
2 changed files with 31 additions and 3 deletions

View File

@ -83,7 +83,7 @@ router.get('/notes/:note', async (ctx, next) => {
}
ctx.body = pack(await renderNote(note, false));
ctx.set('Cache-Control', 'private, max-age=0, must-revalidate');
ctx.set('Cache-Control', 'public, max-age=180');
setResponseType(ctx);
});
@ -162,7 +162,9 @@ async function userInfo(ctx: Router.IRouterContext, user: IUser) {
setResponseType(ctx);
}
router.get('/users/:user', async ctx => {
router.get('/users/:user', async (ctx, next) => {
if (!isActivityPubReq(ctx)) return await next();
if (!ObjectID.isValid(ctx.params.user)) {
ctx.status = 404;
return;