Expected behavior
The Access-Control-Allow-Origin header should be dynamically set based on the incoming request's origin, even when serving a cached response.
Actual behavior
The Access-Control-Allow-Origin header is cached, which results in incorrect CORS headers being returned when serving responses from the cache.
Steps to reproduce
- Enable GraphQL output caching.
- Make a request to the GraphQL endpoint from one origin (e.g., Origin: https://example.com).
- Make another request from a different origin (e.g., Origin: https://another.com) and observe that the Access-Control-Allow-Origin header remains the same as the first request.