Skip to content

Commit

Permalink
fix(symfony): missing http clients varnish purger (#5383)
Browse files Browse the repository at this point in the history
fixes #5382
  • Loading branch information
soyuka authored Feb 1, 2023
1 parent a76ebf2 commit 8520955
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Symfony/Bundle/Resources/config/http_cache_purger.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

<services>
<service id="api_platform.http_cache.purger.varnish" alias="api_platform.http_cache.purger.varnish.ban" public="false" />
<service id="api_platform.http_cache.purger.varnish.ban" class="ApiPlatform\HttpCache\VarnishPurger" public="false" />
<service id="api_platform.http_cache.purger.varnish.ban" class="ApiPlatform\HttpCache\VarnishPurger" public="false">
<argument type="tagged" tag="api_platform.http_cache.http_client" />
</service>
<service id="api_platform.http_cache.purger.varnish.xkey" class="ApiPlatform\HttpCache\VarnishXKeyPurger" public="false">
<argument type="tagged" tag="api_platform.http_cache.http_client" />
<argument>%api_platform.http_cache.invalidation.max_header_length%</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

0 comments on commit 8520955

Please sign in to comment.