From 7767dbd3b8619494c014ffa71065aa818e9a20f0 Mon Sep 17 00:00:00 2001 From: Boegie19 <34578426+Boegie19@users.noreply.github.com> Date: Tue, 12 Mar 2024 22:57:07 +0100 Subject: [PATCH] fix upercease useHeaders not being lowercased --- .../server/utils/keys/generateHeadersKey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-plugin-rest-cache/server/utils/keys/generateHeadersKey.js b/packages/strapi-plugin-rest-cache/server/utils/keys/generateHeadersKey.js index f98c1dc53..0deeffe44 100644 --- a/packages/strapi-plugin-rest-cache/server/utils/keys/generateHeadersKey.js +++ b/packages/strapi-plugin-rest-cache/server/utils/keys/generateHeadersKey.js @@ -2,7 +2,7 @@ function generateHeadersKey(ctx, useHeaders = []) { return useHeaders - .filter((k) => ctx.request.header[k] !== undefined) + .filter((k) => ctx.request.header[k.toLowerCase()] !== undefined) .map((k) => `${k.toLowerCase()}=${ctx.request.header[k.toLowerCase()]}`) // headers are key insensitive .join(','); }