Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fcd0e46

Browse files
[FrameworkBundle] Add framework.http_cache.skip_response_headers option
1 parent 624fd95 commit fcd0e46

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CHANGELOG
1414
* Allow setting private services with the test container
1515
* Register alias for argument for workflow services with workflow name only
1616
* Configure the `ErrorHandler` on `FrameworkBundle::boot()`
17+
* Add `framework.http_cache.skip_response_headers` option
1718

1819
6.2
1920
---

src/Symfony/Bundle/FrameworkBundle/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()

src/Symfony/Bundle/FrameworkBundle/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);

src/Symfony/Bundle/FrameworkBundle/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),

src/Symfony/Component/HttpClient/CachingHttpClient.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function __construct(HttpClientInterface $client, StoreInterface $store,
5252
unset($defaultOptions['debug']);
5353
unset($defaultOptions['default_ttl']);
5454
unset($defaultOptions['private_headers']);
55+
unset($defaultOptions['skip_response_headers']);
5556
unset($defaultOptions['allow_reload']);
5657
unset($defaultOptions['allow_revalidate']);
5758
unset($defaultOptions['stale_while_revalidate']);

0 commit comments

Comments
 (0)