From 3254bfad3585157b8c502330f917b8d7d0ee3b74 Mon Sep 17 00:00:00 2001 From: spencerwooo Date: Sun, 13 Feb 2022 19:09:47 +0800 Subject: [PATCH] stop serving cache for protected routes, close #425 --- pages/api/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pages/api/index.ts b/pages/api/index.ts index 4f13f63..8798f47 100644 --- a/pages/api/index.ts +++ b/pages/api/index.ts @@ -160,6 +160,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) // Fetch password from remote file content if (authTokenPath !== '') { + // Don't server cached response for password protected folders + res.setHeader('Cache-Control', 'no-cache') + try { const token = await axios.get(`${apiConfig.driveApi}/root${encodePath(authTokenPath)}`, { headers: { Authorization: `Bearer ${accessToken}` },