Closed aa-nasr closed 8 months ago
good catch ctx.request.header will always be the in full lowercease. aka everyting in useHeaders is lowercease it works else you are correct and it does not function correctly. let me open a PR to fix this.
Thanks a lot for the effort, @Boegie19
The plugin seems to ignore the headers specified in
useHeaders
option based on case-sensitivity. The problem is that the logic inside the filter method that checks for the header in the request doesn't usetoLowerCase
on the key, although it does exactly that when reading the actual header value in the next line.Is this intended or is it just a mistake?
https://github.com/strapi-community/strapi-plugin-rest-cache/blob/6906cab0f70b6af9ddf994a35ef2798ac5b6f593/packages/strapi-plugin-rest-cache/server/utils/keys/generateHeadersKey.js#L5