From dcabf75bbc02f9fd28c0303401d95fff43e12e63 Mon Sep 17 00:00:00 2001 From: soyuka Date: Tue, 31 Jan 2023 16:46:08 +0100 Subject: [PATCH] fix(symfony): missing http clients varnish purger fixes #5382 --- .../Bundle/Resources/config/http_cache_purger.xml | 4 +++- .../DependencyInjection/ApiPlatformExtensionTest.php | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/Resources/config/http_cache_purger.xml b/src/Symfony/Bundle/Resources/config/http_cache_purger.xml index 788bf3a5750..74d663d709f 100644 --- a/src/Symfony/Bundle/Resources/config/http_cache_purger.xml +++ b/src/Symfony/Bundle/Resources/config/http_cache_purger.xml @@ -6,7 +6,9 @@ - + + + %api_platform.http_cache.invalidation.max_header_length% diff --git a/tests/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php b/tests/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php index c7e5ce5cdba..1bb662864fb 100644 --- a/tests/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php +++ b/tests/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php @@ -1236,4 +1236,15 @@ public function testHttpCacheUrlsConfiguration(): void $this->assertServiceHasTags('api_platform.invalidation_http_client.0', ['api_platform.http_cache.http_client']); $this->assertServiceHasTags('my_scoped_client', ['api_platform.http_cache.http_client']); } + + public function testHttpCacheBanConfiguration(): void + { + $config = self::DEFAULT_CONFIG; + + (new ApiPlatformExtension())->load($config, $this->container); + + $service = $this->container->getDefinition('api_platform.http_cache.purger.varnish.ban'); + $this->assertCount(1, $service->getArguments()); + $this->assertEquals('api_platform.http_cache.http_client', $service->getArgument(0)->getTag()); + } }