Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Closed as not planned
Closed as not planned
Description
Symfony version(s) affected
7.1.0
Description
Cache attribute'svary
property is silently ignored with following config:
framework:set_locale_from_accept_language:true
And following controller
useSymfony\Component\HttpFoundation\JsonResponse;useSymfony\Component\HttpKernel\Attribute\Cache;class SomeController{ #[Cache(smaxage:3600, vary: ['X-Some-Header'])]publicfunctionindex():Response {returnnewJsonResponse("OK"); }}
TheLocaleListener adds an attribute to the request that is used by theResponseListener to add aVary: Accept-Language
header.
However, this occurs before theCacheAttributeListener, which doesn't take the attribute'svary
property into account if there is already aVary
header on the response.
Is this expected?
How to reproduce
See above.
Possible Solution
No response
Additional Context
No response