Skip to content

Commit e7f36e6

Browse files
committed
Only throw deprecation when user explicitly sets option
1 parent 4e60554 commit e7f36e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/CachePlugin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ private function configureOptions(OptionsResolver $resolver)
338338
'cache_lifetime' => 86400 * 30, // 30 days
339339
'default_ttl' => 0,
340340
//Deprecated as of v1.3, to be removed in v2.0. Use respect_response_cache_directives instead
341-
'respect_cache_headers' => true,
341+
'respect_cache_headers' => null,
342342
'hash_algo' => 'sha1',
343343
'methods' => ['GET', 'HEAD'],
344344
'respect_response_cache_directives' => ['no-cache', 'private', 'max-age', 'no-store'],
@@ -363,7 +363,7 @@ private function configureOptions(OptionsResolver $resolver)
363363
@trigger_error('The option "respect_cache_headers" is deprecated since version 1.3 and will be removed in 2.0. Use "respect_response_cache_directives" instead.', E_USER_DEPRECATED);
364364
}
365365

366-
return $value;
366+
return null === $value ? true : $value;
367367
});
368368

369369
$resolver->setNormalizer('respect_response_cache_directives', function (Options $options, $value) {

0 commit comments

Comments
 (0)