From 297c9a0c08eda2d665de503f6479a5dac75be59f Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Mon, 20 Apr 2020 01:57:37 +1200 Subject: [PATCH] Fix feed blocked symbols and cache-control --- src/site/api/feed.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/site/api/feed.js b/src/site/api/feed.js index c01262e..e7f9042 100644 --- a/src/site/api/feed.js +++ b/src/site/api/feed.js @@ -24,7 +24,7 @@ module.exports = [ statusCode: 200, contentType: data.contentType, headers: { - "Cache-Control": `max-age=${userRequestCache.getTtl("user/"+user.data.username, 1000)}` + "Cache-Control": `public, max-age=${userRequestCache.getTtl("user/"+user.data.username, 1000)}` }, content: data.content } @@ -36,11 +36,12 @@ module.exports = [ message: "This user doesn't exist.", withInstancesLink: false }) - } else if (error === constants.symbols.INSTAGRAM_DEMANDS_LOGIN) { + } else if (error === constants.symbols.INSTAGRAM_DEMANDS_LOGIN || error === constants.symbols.RATE_LIMITED) { return { statusCode: 503, contentType: "text/html", headers: { + "Cache-Control": `public, max-age=${userRequestCache.getTtl("user/"+fill[0], 1000)}`, "Retry-After": userRequestCache.getTtl("user/"+fill[0], 1000) }, content: pugCache.get("pug/blocked.pug").web({