Dont serve cache if API authorization fails
ZaidWaseem10 opened this issue · 1 comments
ZaidWaseem10 commented
I have an API KEY header with each request. Generally whats happening is that if the first request has correct api key, the response will be cached. Now if anyone makes a request to the same endpoint without correct api key, the cache will also be served. It fails the security measures taken for the endpoint. Is there any way to validate API-KEY in each and every request? even though the response is cached.
josedev999 commented
@ZaidWaseem10 I think it is matter of how you put middlewares in order.
You need to put authorization middleware in front of cache middleware.