File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -254,12 +254,10 @@ public function write(Request $request, Response $response)
254254 // Tags
255255 $ tags = [];
256256 if ($ response ->headers ->has ($ this ->options ['cache_tags_header ' ])) {
257- // Symfony < 4.4
258- $ headers = $ response ->headers ->get ($ this ->options ['cache_tags_header ' ], '' , false );
259- if (\is_string ($ headers )) {
260- // Symfony >= 4.4
261- $ headers = $ response ->headers ->all ($ this ->options ['cache_tags_header ' ]);
262- }
257+ // Compatibility with Symfony 3+
258+ $ allHeaders = $ response ->headers ->all ();
259+ $ key = str_replace ('_ ' , '- ' , strtolower ($ this ->options ['cache_tags_header ' ]));
260+ $ headers = isset ($ allHeaders [$ key ]) ? $ allHeaders [$ key ] : [];
263261
264262 foreach ($ headers as $ header ) {
265263 foreach (explode (', ' , $ header ) as $ tag ) {
You can’t perform that action at this time.
0 commit comments