Add quotes to etag

This commit is contained in:
Ajay 2024-04-11 14:11:04 -04:00
parent dc2115ef20
commit f43e59250f

View file

@ -18,7 +18,7 @@ export function cacheMiddlware(req: Request, res: Response, next: NextFunction):
.then(redisLastModified => {
if (redisLastModified <= new Date(Number(lastModified) + 1000)) {
// match cache, generate etag
const etag = `${hashType};${hashKey};${service};${redisLastModified.getTime()}` as ETag;
const etag = `"${hashType};${hashKey};${service};${redisLastModified.getTime()}"` as ETag;
res.status(304).set("etag", etag).send();
}
else next();