From 653ec0cbb0cb1a14d0f48b4d10b91007e8876be8 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Thu, 22 Nov 2018 23:17:58 +0900 Subject: No cache /notes/:note (#3382) --- src/server/activitypub.ts | 2 +- src/server/web/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts index 888feb08ce..0d4e244856 100644 --- a/src/server/activitypub.ts +++ b/src/server/activitypub.ts @@ -76,7 +76,7 @@ router.get('/notes/:note', async (ctx, next) => { } ctx.body = pack(await renderNote(note, false)); - ctx.set('Cache-Control', 'public, max-age=180'); + ctx.set('Cache-Control', 'private, max-age=0, must-revalidate'); setResponseType(ctx); }); diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 616aaa36bb..42292cd398 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -111,7 +111,7 @@ router.get('/notes/:note', async ctx => { note: _note, summary: getNoteSummary(_note) }); - ctx.set('Cache-Control', 'public, max-age=180'); + ctx.set('Cache-Control', 'private, max-age=0, must-revalidate'); } else { ctx.status = 404; } -- cgit v1.2.3-freya From 2a0b62d26dd253779c0e02933259cf3fe35c5c99 Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 22 Nov 2018 18:09:04 +0100 Subject: Fix #3343 (#3383) Setting "X-Forwarded-Proto: https" in the SSL proxy is the correct way to do this --- src/server/api/common/signin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/api/common/signin.ts b/src/server/api/common/signin.ts index 8d44b377fe..3a5ba0ea04 100644 --- a/src/server/api/common/signin.ts +++ b/src/server/api/common/signin.ts @@ -9,8 +9,8 @@ export default function(ctx: Koa.Context, user: ILocalUser, redirect = false) { path: '/', domain: config.hostname, // SEE: https://github.com/koajs/koa/issues/974 - //secure: config.url.startsWith('https'), - secure: false, + // When using a SSL proxy it should be configured to add the "X-Forwarded-Proto: https" header + secure: config.url.startsWith('https'), httpOnly: false, expires: new Date(Date.now() + expires), maxAge: expires -- cgit v1.2.3-freya