Skip to content

Commit a7ab833

Browse files
alexandre-dauboisnicolas-grekas
authored andcommitted
[FrameworkBundle] Add framework.http_cache.skip_response_headers option
1 parent 39bde6f commit a7ab833

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CHANGELOG
1515
* Register alias for argument for workflow services with workflow name only
1616
* Configure the `ErrorHandler` on `FrameworkBundle::boot()`
1717
* Allow setting `debug.container.dump` to `false` to disable dumping the container to XML
18+
* Add `framework.http_cache.skip_response_headers` option
1819

1920
6.2
2021
---

DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ private function addHttpCacheSection(ArrayNodeDefinition $rootNode): void
263263
->performNoDeepMerging()
264264
->scalarPrototype()->end()
265265
->end()
266+
->arrayNode('skip_response_headers')
267+
->performNoDeepMerging()
268+
->scalarPrototype()->end()
269+
->end()
266270
->booleanNode('allow_reload')->end()
267271
->booleanNode('allow_revalidate')->end()
268272
->integerNode('stale_while_revalidate')->end()

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,10 @@ private function registerHttpCacheConfiguration(array $config, ContainerBuilder
762762
unset($options['private_headers']);
763763
}
764764

765+
if (!$options['skip_response_headers']) {
766+
unset($options['skip_response_headers']);
767+
}
768+
765769
$container->getDefinition('http_cache')
766770
->setPublic($config['enabled'])
767771
->replaceArgument(3, $options);

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphor
671671
'enabled' => false,
672672
'debug' => '%kernel.debug%',
673673
'private_headers' => [],
674+
'skip_response_headers' => [],
674675
],
675676
'rate_limiter' => [
676677
'enabled' => !class_exists(FullStack::class) && class_exists(TokenBucketLimiter::class),

0 commit comments

Comments
 (0)