UNPKG

strapi-plugin-rest-cache

Version:
14 lines (9 loc) 250 B
'use strict'; function etagMatch(ctx, etagCached) { const ifNoneMatch = ctx.request.headers['if-none-match']; if (!ifNoneMatch) { return false; } return ifNoneMatch.indexOf(`"${etagCached}"`) !== -1; } module.exports = { etagMatch };