diff --git a/CHANGELOG.md b/CHANGELOG.md index cea9ac9c..056032d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +# 1.26.1 - 2022-04-29 + +- Fixed: Setting the cache plugin option `respect_response_cache_directives` to `null` makes the + plugin use the default set of directives instead of triggering an error. + # 1.26.0 - 2022-03-17 - Fixed you can now configure the cache plugin default_ttl with `null`. diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index d287b108..fe846b0d 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -776,7 +776,7 @@ private function createCachePluginNode() ->end() ->end() ->variableNode('respect_response_cache_directives') - ->info('A list of cache directives to respect when caching responses') + ->info('A list of cache directives to respect when caching responses. Omit or set to null to respect the default set of directives.') ->validate() ->always(function ($v) { if (is_null($v) || is_array($v)) { diff --git a/src/DependencyInjection/HttplugExtension.php b/src/DependencyInjection/HttplugExtension.php index 1a8aa0cf..22912197 100644 --- a/src/DependencyInjection/HttplugExtension.php +++ b/src/DependencyInjection/HttplugExtension.php @@ -198,6 +198,9 @@ private function configurePluginByName($name, Definition $definition, array $con switch ($name) { case 'cache': $options = $config['config']; + if (\array_key_exists('respect_response_cache_directives', $options) && null === $options['respect_response_cache_directives']) { + unset($options['respect_response_cache_directives']); + } if (!empty($options['cache_key_generator'])) { $options['cache_key_generator'] = new Reference($options['cache_key_generator']); }