mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Check for capitalized cache control header
This commit is contained in:
@@ -10,7 +10,8 @@ const checkCacheMiddleware: RequestHandler = asyncHandler(async (req, res, next)
|
||||
if (env.CACHE_ENABLED !== true) return next();
|
||||
if (!cache) return next();
|
||||
|
||||
if (req.headers['cache-control']?.includes('no-cache')) return next();
|
||||
if (req.headers['cache-control']?.includes('no-cache') || req.headers['Cache-Control']?.includes('no-cache'))
|
||||
return next();
|
||||
|
||||
const key = getCacheKey(req);
|
||||
const cachedData = await cache.get(key);
|
||||
|
||||
Reference in New Issue
Block a user