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

Skip to content

Commit fa37492

Browse files
bug #49480 [FrameworkBundle] Add framework.http_cache.skip_response_headers option (alexandre-daubois)
This PR was merged into the 6.3 branch. Discussion ---------- [FrameworkBundle] Add `framework.http_cache.skip_response_headers` option | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Followup of #49318 | License | MIT | Doc PR | symfony/symfony-docs#17951 While thinking about where to add documentation for symfony/symfony-docs#17941, I realized that all HTTP Cache options are available under `framework.http_cache` config. By adding this option as well, we'll be able to write documentation about it, in the framework configuration reference. Commits ------- 010aa39 [FrameworkBundle] Add `framework.http_cache.skip_response_headers` option
2 parents 22c576b + 010aa39 commit fa37492

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
@@ -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
---

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)