You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a middleware group secure-api that contains a middleware that checks for an api key in the request header.
This works great until the response is cached. Once the response is cached, then the cached response will always be returned regardless of whether the request still has the api key header.
The reason for this is that the order of the middleware application is the wrong way round.
by first allowing the Cache to respond the cached response, my custom middlewares which are in the secure-api group never get the chance to do anything.
How to reproduce
create a middleware that checks an arbitrary http header
Bug description
I created a middleware group
secure-api
that contains a middleware that checks for an api key in the request header.This works great until the response is cached. Once the response is cached, then the cached response will always be returned regardless of whether the request still has the api key header.
The reason for this is that the order of the middleware application is the wrong way round.
see
statamic.api.middleware
by first allowing the
Cache
to respond the cached response, my custom middlewares which are in thesecure-api
group never get the chance to do anything.How to reproduce
Http/Kernel.php
create a new middleware group.env
configure statamic REST api to use the given middleware groupLogs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
No response
The text was updated successfully, but these errors were encountered: